Skip to content

Commit 57375e4

Browse files
[SYCL] Cleanup Windows testing (#17755)
This is a joined cherry-pick of #16286, #17046 and #17100 made to align tests between `sycl` and `sycl-rel-6_1_0` branches to make the pre-commit more stable on the latter. Descriptions of cherry-picked commits: --- Fix postcommit failure and move tests in right folder (#16286) opencl cpu fails without a stack trace Patch-By: Victor Lomuller <[email protected]> --- [SYCL][E2E] Limit work group size in WorkGroupScratchMemory tests (#17046) Some devices don't support work group sizes of 1024, so use the maximum size if it is smaller in the copy_dynamic_size.cpp and dynamic_unused.cpp tests. Patch-By: Ross Brunton <[email protected]> --- [SYCL][E2E] Use size_t rather than unsigned long in WorkGroupScratchMemory tests (#17100) The max work group size is a `size_t`, rather than an `unsigned long`. This trips up older versions of MSVC where `size_t` happens to be `unsigned long long`. Patch-By: Ross Brunton <[email protected]> ---
1 parent 4cc32e6 commit 57375e4

10 files changed

+30
-21
lines changed

sycl/test-e2e/WorkGroupMemory/Dynamic/copy_dynamic_size.cpp renamed to sycl/test-e2e/WorkGroupScratchMemory/copy_dynamic_size.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <sycl/group_barrier.hpp>
1111
#include <sycl/usm.hpp>
1212

13-
constexpr size_t Size = 1024;
1413
using DataType = int;
1514

1615
namespace sycl_ext = sycl::ext::oneapi::experimental;
@@ -31,23 +30,27 @@ void copy_via_smem(DataType *a, DataType *b, sycl::nd_item<1> it) {
3130

3231
int main() {
3332
sycl::queue queue;
34-
DataType *a = sycl::malloc_device<DataType>(Size, queue);
35-
DataType *b = sycl::malloc_device<DataType>(Size, queue);
36-
std::vector<DataType> a_host(Size, 1.0);
37-
std::vector<DataType> b_host(Size, -5.0);
33+
auto size = std::min(
34+
queue.get_device().get_info<sycl::info::device::max_work_group_size>(),
35+
size_t{1024});
3836

39-
queue.copy(a_host.data(), a, Size).wait_and_throw();
37+
DataType *a = sycl::malloc_device<DataType>(size, queue);
38+
DataType *b = sycl::malloc_device<DataType>(size, queue);
39+
std::vector<DataType> a_host(size, 1.0);
40+
std::vector<DataType> b_host(size, -5.0);
41+
42+
queue.copy(a_host.data(), a, size).wait_and_throw();
4043

4144
queue
4245
.submit([&](sycl::handler &cgh) {
43-
cgh.parallel_for(sycl::nd_range<1>({Size}, {Size}),
46+
cgh.parallel_for(sycl::nd_range<1>({size}, {size}),
4447
sycl_ext::properties{sycl_ext::work_group_scratch_size(
45-
Size * sizeof(DataType))},
48+
size * sizeof(DataType))},
4649
[=](sycl::nd_item<1> it) { copy_via_smem(a, b, it); });
4750
})
4851
.wait_and_throw();
4952

50-
queue.copy(b, b_host.data(), Size).wait_and_throw();
53+
queue.copy(b, b_host.data(), size).wait_and_throw();
5154
for (size_t i = 0; i < b_host.size(); i++) {
5255
assert(b_host[i] == a_host[i]);
5356
}

sycl/test-e2e/WorkGroupMemory/Dynamic/dynamic_alloc_local_accessor.cpp renamed to sycl/test-e2e/WorkGroupScratchMemory/dynamic_alloc_local_accessor.cpp

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

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

88
// Test work_group_dynamic extension with allocation size specified at runtime

sycl/test-e2e/WorkGroupMemory/Dynamic/dynamic_alloc_ptr_alias.cpp renamed to sycl/test-e2e/WorkGroupScratchMemory/dynamic_alloc_ptr_alias.cpp

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

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

88
// Test work_group_dynamic extension with allocation size specified at runtime

sycl/test-e2e/WorkGroupMemory/Dynamic/dynamic_allocation.cpp renamed to sycl/test-e2e/WorkGroupScratchMemory/dynamic_allocation.cpp

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

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

88
// Test work_group_dynamic extension with allocation size specified at runtime.

sycl/test-e2e/WorkGroupMemory/Dynamic/dynamic_unused.cpp renamed to sycl/test-e2e/WorkGroupScratchMemory/dynamic_unused.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,36 @@
99
#include <sycl/ext/oneapi/work_group_scratch_memory.hpp>
1010
#include <sycl/usm.hpp>
1111

12-
constexpr size_t Size = 1024;
1312
using DataType = int;
1413

1514
namespace sycl_ext = sycl::ext::oneapi::experimental;
1615

1716
int main() {
1817
sycl::queue queue;
19-
DataType *a = sycl::malloc_device<DataType>(Size, queue);
20-
DataType *b = sycl::malloc_device<DataType>(Size, queue);
21-
std::vector<DataType> a_host(Size, 1.0);
22-
std::vector<DataType> b_host(Size, -5.0);
18+
auto size = std::min(
19+
queue.get_device().get_info<sycl::info::device::max_work_group_size>(),
20+
size_t{1024});
2321

24-
queue.copy(a_host.data(), a, Size).wait_and_throw();
22+
DataType *a = sycl::malloc_device<DataType>(size, queue);
23+
DataType *b = sycl::malloc_device<DataType>(size, queue);
24+
std::vector<DataType> a_host(size, 1.0);
25+
std::vector<DataType> b_host(size, -5.0);
26+
27+
queue.copy(a_host.data(), a, size).wait_and_throw();
2528

2629
queue
2730
.submit([&](sycl::handler &cgh) {
28-
cgh.parallel_for(sycl::nd_range<1>({Size}, {Size}),
31+
cgh.parallel_for(sycl::nd_range<1>({size}, {size}),
2932
sycl_ext::properties{sycl_ext::work_group_scratch_size(
30-
Size * sizeof(DataType))},
33+
size * sizeof(DataType))},
3134
[=](sycl::nd_item<1> it) {
3235
b[it.get_local_linear_id()] =
3336
a[it.get_local_linear_id()];
3437
});
3538
})
3639
.wait_and_throw();
3740

38-
queue.copy(b, b_host.data(), Size).wait_and_throw();
41+
queue.copy(b, b_host.data(), size).wait_and_throw();
3942
for (size_t i = 0; i < b_host.size(); i++) {
4043
assert(b_host[i] == a_host[i]);
4144
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
# https://github.com/intel/llvm/issues/16072
3+
config.unsupported_features += ['hip']

0 commit comments

Comments
 (0)