Skip to content

Commit 237ab90

Browse files
author
Victor Lomuller
committed
fix work_group_scrach_memory
Signed-off-by: Victor Lomuller <[email protected]>
1 parent fc44c0b commit 237ab90

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

llvm/lib/SYCLLowerIR/LowerWGLocalMemory.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ static bool dynamicWGLocalMemory(Module &M) {
205205
GlobalVariable::NotThreadLocal, // ThreadLocalMode
206206
LocalAS // AddressSpace
207207
);
208+
LocalMemArrayGV->setUnnamedAddr(GlobalVariable::UnnamedAddr::Local);
208209
constexpr int DefaultMaxAlignment = 128;
209210
if (!TT.isSPIROrSPIRV())
210211
LocalMemArrayGV->setAlignment(Align{DefaultMaxAlignment});

sycl/test-e2e/WorkGroupScratchMemory/dynamic_alloc_local_accessor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %{run} %t.out
33
//
44

5-
// UNSUPPORTED: gpu-intel-gen12, cpu
5+
// UNSUPPORTED: gpu-intel-gen12
66
// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/16072
77

88
// Test work_group_dynamic extension with allocation size specified at runtime
@@ -35,8 +35,8 @@ int main() {
3535
sycl_ext::properties properties{static_size};
3636
auto LocalAccessor =
3737
sycl::local_accessor<int>(WgSize * RepeatWG * sizeof(int), Cgh);
38-
Cgh.parallel_for(nd_range<1>(range<1>(Size), range<1>(WgSize)), properties,
39-
[=](nd_item<1> Item) {
38+
Cgh.parallel_for(nd_range<1>(range<1>(WgSize * WgCount), range<1>(WgSize)),
39+
properties, [=](nd_item<1> Item) {
4040
int *Ptr = reinterpret_cast<int *>(
4141
sycl_ext::get_work_group_scratch_memory());
4242
size_t GroupOffset =

sycl/test-e2e/WorkGroupScratchMemory/dynamic_alloc_ptr_alias.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %{run} %t.out
33
//
44

5-
// UNSUPPORTED: gpu-intel-gen12, cpu
5+
// UNSUPPORTED: gpu-intel-gen12
66
// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/16072
77

88
// Test work_group_dynamic extension with allocation size specified at runtime
@@ -33,8 +33,8 @@ int main() {
3333
sycl_ext::work_group_scratch_size static_size(WgSize * RepeatWG *
3434
sizeof(int));
3535
sycl_ext::properties properties{static_size};
36-
Cgh.parallel_for(nd_range<1>(range<1>(Size), range<1>(WgSize)), properties,
37-
[=](nd_item<1> Item) {
36+
Cgh.parallel_for(nd_range<1>(range<1>(WgSize * WgCount), range<1>(WgSize)),
37+
properties, [=](nd_item<1> Item) {
3838
int *Ptr = reinterpret_cast<int *>(
3939
sycl_ext::get_work_group_scratch_memory());
4040
size_t GroupOffset =

sycl/test-e2e/WorkGroupScratchMemory/dynamic_allocation.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %{run} %t.out
33
//
44

5-
// UNSUPPORTED: gpu-intel-gen12, cpu
5+
// UNSUPPORTED: gpu-intel-gen12
66
// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/16072
77

88
// Test work_group_dynamic extension with allocation size specified at runtime.
@@ -32,8 +32,8 @@ int main() {
3232
sycl_ext::work_group_scratch_size static_size(WgSize * RepeatWG *
3333
sizeof(int));
3434
sycl_ext::properties properties{static_size};
35-
Cgh.parallel_for(nd_range<1>(range<1>(Size), range<1>(WgSize)), properties,
36-
[=](nd_item<1> Item) {
35+
Cgh.parallel_for(nd_range<1>(range<1>(WgSize * WgCount), range<1>(WgSize)),
36+
properties, [=](nd_item<1> Item) {
3737
int *Ptr = reinterpret_cast<int *>(
3838
sycl_ext::get_work_group_scratch_memory());
3939
size_t GroupOffset =

0 commit comments

Comments
 (0)