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

Commit 5f9e79a

Browse files
[SYCL] Update more tests to account for optionality of double type (#1242)
1 parent 5b915e1 commit 5f9e79a

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

SYCL/GroupAlgorithm/SYCL2020/sort.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -I . -o %t.out
1+
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -fsycl-device-code-split=per_kernel %s -I . -o %t.out
22
// RUN: %CPU_RUN_PLACEHOLDER %t.out
33
// RUN: %GPU_RUN_PLACEHOLDER %t.out
44
// RUN: %ACC_RUN_PLACEHOLDER %t.out
@@ -357,8 +357,10 @@ int main(int argc, char *argv[]) {
357357
test_sort_by_type<std::int32_t>(q, sizes[i]);
358358
test_sort_by_type<std::uint32_t>(q, sizes[i]);
359359
test_sort_by_type<float>(q, sizes[i]);
360-
test_sort_by_type<sycl::half>(q, sizes[i]);
361-
test_sort_by_type<double>(q, sizes[i]);
360+
if (q.get_device().has(sycl::aspect::fp16))
361+
test_sort_by_type<sycl::half>(q, sizes[i]);
362+
if (q.get_device().has(sycl::aspect::fp64))
363+
test_sort_by_type<double>(q, sizes[i]);
362364
test_sort_by_type<std::size_t>(q, sizes[i]);
363365

364366
test_custom_type(q, sizes[i]);

SYCL/SubGroup/info.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// See https://github.com/intel/llvm/issues/2922 for more info
2-
// UNSUPPORTED: cuda || hip
3-
41
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
52
// RUN: %CPU_RUN_PLACEHOLDER %t.out
63
// RUN: %GPU_RUN_PLACEHOLDER %t.out
@@ -40,7 +37,7 @@ int main() {
4037
auto Kernel = KB.get_kernel(KernelID);
4138
range<2> GlobalRange{50, 40};
4239

43-
buffer<double, 2> ABuf{GlobalRange}, BBuf{GlobalRange}, CBuf{GlobalRange};
40+
buffer<float, 2> ABuf{GlobalRange}, BBuf{GlobalRange}, CBuf{GlobalRange};
4441

4542
Queue.submit([&](sycl::handler &cgh) {
4643
auto A = ABuf.get_access<access::mode::read_write>(cgh);

SYCL/USM/copy.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88
//
9-
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t1.out
9+
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -fsycl-device-code-split=per_kernel %s -o %t1.out
1010
// RUN: %CPU_RUN_PLACEHOLDER %t1.out
1111
// RUN: %GPU_RUN_PLACEHOLDER %t1.out
1212
// RUN: %ACC_RUN_PLACEHOLDER %t1.out
@@ -27,12 +27,11 @@ struct test_struct {
2727
long long d;
2828
half e;
2929
float f;
30-
double g;
3130
};
3231

3332
bool operator==(const test_struct &lhs, const test_struct &rhs) {
3433
return lhs.a == rhs.a && lhs.b == rhs.b && lhs.c == rhs.c && lhs.d == rhs.d &&
35-
lhs.e == rhs.e && lhs.f == rhs.f && lhs.g == rhs.g;
34+
lhs.e == rhs.e && lhs.f == rhs.f;
3635
}
3736

3837
template <typename T> T *regular(queue q, alloc kind) {
@@ -44,6 +43,9 @@ template <typename T> T *aligned(queue q, alloc kind) {
4443
}
4544

4645
template <typename T> void test(queue q, T val, T *src, T *dst, bool dev_dst) {
46+
if (std::is_same_v<T, double> && !q.get_device().has(aspect::fp64))
47+
return;
48+
4749
q.fill(src, val, N).wait();
4850

4951
// Use queue::copy for the first half and handler::copy for the second
@@ -87,7 +89,7 @@ int main() {
8789
queue q;
8890
auto dev = q.get_device();
8991

90-
test_struct test_obj{4, 42, 424, 4242, 4.2f, 4.242f, 4.24242};
92+
test_struct test_obj{4, 42, 424, 4242, 4.2f, 4.242f};
9193

9294
if (dev.has(aspect::usm_host_allocations)) {
9395
runTests<short>(q, 4, alloc::host, alloc::host);

0 commit comments

Comments
 (0)