Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit 38d5ea6

Browse files
Add a comment on alternative ways of using the returned pointer
1 parent 81208dd commit 38d5ea6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

SYCL/GroupLocalMemory/group_local_memory.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ int main() {
4040
auto CounterAcc = CounterBuf.get_access<access::mode::read_write>(Cgh);
4141
Cgh.parallel_for<KernelA>(
4242
nd_range<1>(range<1>(Size), range<1>(WgSize)), [=](nd_item<1> Item) {
43+
// Some alternative (and functionally equivalent) ways to use this
44+
// would be:
45+
// auto Ptr = group_local_memory<Foo>(Item.get_group(), ...);
46+
// Foo &Ref = *group_local_memory<Foo>(Item.get_group(), ...);
4347
multi_ptr<Foo, access::address_space::local_space> Ptr =
4448
group_local_memory<Foo>(Item.get_group(), 1,
4549
CounterAcc[Item.get_group_linear_id()]);

0 commit comments

Comments
 (0)