- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to create a local share memory buffer, and sycl::accessor constructor say that the local option is deprecated and say to use local_accesor.
local __SYCL2020_DEPRECATED("use `local_accessor` instead") = 2016,
but local_accessor class doesn't even compile. for what I can see it has not constructor,
I try many different combinations of parameters, none compiled.
range<1> xxxxx(D_COUNTING_SORT_LOCAL_BLOCK_SIZE);
handler.parallel_for_work_group(workGroupCountRange, workGroupSizeRange, [=](group<1> group)
{
// make local shared memory buffers
//sycl::local_accessor<unsigned, 1, sycl::access::mode::read_write, sycl::access::target::local> cacheSortedKey(D_COUNTING_SORT_LOCAL_BLOCK_SIZE, handler);
//sycl::local_accessor<unsigned> cacheSortedKey(xxxxx, handler);
sycl::accessor<unsigned, 1, sycl::access::mode::read_write, sycl::access::target::local> cacheSortedKey(xxxxx, handler);
//sycl::local_accessor<unsigned, 1> cacheSortedKey(xxxxx, handler);
so how can I use local shared memory in a code block that look like the on below
handler.parallel_for_work_group(workGroupCountRange, workGroupSizeRange, [=](group<1> group)
{
// some shared memory buffer here,
...
...
group.parallel_for_work_item([&](h_item<1> item)
{
});
}
I am going by the krohnos doc file:
https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#subsec:accessors
it states this:
To allocate local memory within a kernel, the user can either pass a sycl::local_accessor object as a argument to an ND-range kernel (that has a user-defined work-group size), or can define a variable in work-group scope inside sycl::parallel_for_work_group.
Any variable defined inside a sycl::parallel_for scope or sycl::parallel_for_work_item scope will be allocated in private memory. Any variable defined inside a sycl::parallel_for_work_group scope will be allocated in local memory.
Thanks.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thank you for posting in Intel Communities.
Please try with the below local_accessor command, as 'target::local' is deprecated.
local_accessor<unsigned, 1> cacheSortedKey(xxxxx, handler);
Please refer to the Intel oneAPI DPC++/C++ compiler release notes link below.
Could you please try it on your end and let us know if you face any issues?
Thanks and Regards,
Pendyala Sesha Srinivas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ah thank, I actually discovered that last Sunday.
after typing like this
sycl::accessor<T, 1> srcAccessor(src, handler);
sycl::accessor<int, 1> scanAccessor(scansBuffer, handler);
sycl::local_accessor<int, 1> counters(D_COUNTING_SORT_LOCAL_BLOCK_SIZE, handler);
It compiles fine,
I learned that I can no realize on default template parameters,
It is my own fault, since I never use default parameters for anything on any code I write,
but here I am.
thank you very much.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Glad to know that your issue is resolved. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.
Thanks and Regards,
Pendyala Sesha Srinivas
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page