- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm trying to implement a piece of code on an arria10 soc development board using openCL. The kernel code has declarations of two local memories as follows
local float __attribute__((memory, numbanks(8),bankwidth(4))) lmemA[1024][8];
local float __attribute__((memory, numbanks(2),bankwidth(4))) lmemB[1024][2];
The whole idea is to get a cumulative memory of size [1024][10]. since the compiler allows <numbanks> property to be in the powers of 2, (I don't want to use a numbank value of 16, when i only need 10 banks for 10 parallel accesses on the lowest dimension), I am declaring two different local memory instantiations such that overall my size requirement is satisfied as well as the compiler's need for power of 2 numbanks value.
Correspondingly the rest of the code was modified so as to accommodate two local memories instead of just the one of size [1024][10].
However, on compilation the compiler throws an error
"Compiler Error : Attempted to merge local memories but found conflicting memory attributes"
I don't want the compiler to merge the local memories, and there seems to be not much documentation regarding this problem.
Is there any other work around for this compilation to succeed?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Following the problem about "conflicting memory attributes", you need to set your bankwidth based on your array size. Refer to section 8.4.1 here: https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/hb/opencl-sdk/aocl-best-practices-guide.pdf#page=157
Regards,
Nurina
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thank you for using Intel Community Forum. We are currently investigating your problem and will get back to you.
Regards,
Nurina
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
There are a few ways for you to make sure the memory does not merge. This video lecture on Memory Optimization for OpenCL contains a few suggestions: https://www.youtube.com/watch?v=1zGpN28mXN4&t=1079s
You may find these documents to be useful:
- https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/hb/opencl-sdk/aocl-best-practices-guide.pdf
- https://www.intel.com/content/www/us/en/programmable/documentation/mwh1391807965224.html
Regards,
Nurina
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Following the problem about "conflicting memory attributes", you need to set your bankwidth based on your array size. Refer to section 8.4.1 here: https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/hb/opencl-sdk/aocl-best-practices-guide.pdf#page=157
Regards,
Nurina
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for the answer.
We found out one more way to prevent this from happening. By declaring one memory as local and another as private(since its a single work item kernel, both behave the same). It worked and the compiler doesnt merge them anymore.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thank you for sharing your solution. I'm glad your problem is solved, I now transition this thread to community support. If you have a new question, feel free to open a new thread to get the support from Intel experts. Otherwise, the community users will continue to help you on this thread. Thank you.
Regards,
Nurina
P/S: If you like my comment, feel free to give Kudos. If my comment solved your problem, feel free to accept my comment as solution!
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page