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

Commit 5b915e1

Browse files
[SYCL] Check for aspect::fp64 in ESIMD/api/*ops_heavy.cpp (#1248)
1 parent fc64e4e commit 5b915e1

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

SYCL/ESIMD/api/bin_and_cmp_ops_heavy.cpp

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// Exclude PVC not to run same test cases twice (via the *_pvc.cpp variant).
99
// REQUIRES: gpu && !gpu-intel-pvc
1010
// UNSUPPORTED: cuda || hip
11-
// RUN: %clangxx -fsycl %s -o %t.out
11+
// RUN: %clangxx -fsycl-device-code-split=per_kernel -fsycl %s -o %t.out
1212
// RUN: %GPU_RUN_PLACEHOLDER %t.out
1313

1414
// Tests various binary operations applied to simd objects.
@@ -266,11 +266,13 @@ int main(void) {
266266
auto arith_ops = esimd_test::ArithBinaryOpsNoDiv;
267267
passed &= test<unsigned char, int, 1, BinOp, VSf, IDf>(arith_ops, q);
268268
passed &= test<char, float, 7, BinOp, VEf, IDf>(arith_ops, q, 0.000001f);
269-
passed &= test<short, double, 7, BinOp, VEf, IDf>(arith_ops, q, 1e-15);
269+
if (dev.has(aspect::fp64))
270+
passed &= test<short, double, 7, BinOp, VEf, IDf>(arith_ops, q, 1e-15);
270271
passed &= test<float, float, 32, BinOp, VEf, IDf>(arith_ops, q, 0.000001f);
271272
passed &= test<half, char, 1, BinOp, verify_n, IDf>(arith_ops, q, 1);
272273
passed &= test<half, unsigned int, 32, BinOp, VSf, IDf>(arith_ops, q, 1);
273-
passed &= test<double, half, 7, BinOp, VSf, IDf>(arith_ops, q);
274+
if (dev.has(aspect::fp64))
275+
passed &= test<double, half, 7, BinOp, VSf, IDf>(arith_ops, q);
274276
passed &= test<short, uint64_t, 7, BinOp, VSf, IDf>(arith_ops, q);
275277
#ifdef USE_BF16
276278
passed &= test<bfloat16, int, 8, BinOp, VSf, IDf>(arith_ops, q);
@@ -282,13 +284,15 @@ int main(void) {
282284
passed &= test<unsigned char, int, 1, BinOp, VSf, IDf>(div_op, q);
283285
passed &= test<char, float, 7, BinOp, VEf, IDf>(div_op, q, 0.000001f);
284286
#ifndef WA_BUG
285-
passed &= test<short, double, 7, BinOp, VSf, IDf>(div_op, q);
287+
if (dev.has(aspect::fp64))
288+
passed &= test<short, double, 7, BinOp, VSf, IDf>(div_op, q);
286289
#endif // WA_BUG
287290
passed &= test<float, float, 32, BinOp, VEf, IDf>(div_op, q, 0.000001f);
288291
passed &= test<half, char, 1, BinOp, verify_n, IDf>(div_op, q, 1);
289292
passed &= test<half, unsigned int, 32, BinOp, VSf, IDf>(div_op, q, 1);
290293
#ifndef WA_BUG
291-
passed &= test<double, half, 7, BinOp, VSf, IDf>(div_op, q);
294+
if (dev.has(aspect::fp64))
295+
passed &= test<double, half, 7, BinOp, VSf, IDf>(div_op, q);
292296
#endif // WA_BUG
293297
passed &= test<short, uint64_t, 7, BinOp, VSf, IDf>(div_op, q);
294298
#ifdef USE_BF16
@@ -327,11 +331,13 @@ int main(void) {
327331
auto cmp_ops = esimd_test::CmpOps;
328332
passed &= test<unsigned char, int, 1, CmpOp, VSf, IDf>(cmp_ops, q);
329333
passed &= test<char, float, 7, CmpOp, VSf, IDf>(cmp_ops, q);
330-
passed &= test<short, double, 7, CmpOp, VSf, IDf>(cmp_ops, q);
334+
if (dev.has(aspect::fp64))
335+
passed &= test<short, double, 7, CmpOp, VSf, IDf>(cmp_ops, q);
331336
passed &= test<float, float, 32, CmpOp, VSf, IDf>(cmp_ops, q);
332337
passed &= test<half, char, 1, CmpOp, VSf, IDf>(cmp_ops, q, 1);
333338
passed &= test<half, unsigned int, 32, CmpOp, VSf, IDf>(cmp_ops, q, 1);
334-
passed &= test<double, half, 7, CmpOp, VSf, IDf>(cmp_ops, q);
339+
if (dev.has(aspect::fp64))
340+
passed &= test<double, half, 7, CmpOp, VSf, IDf>(cmp_ops, q);
335341
passed &= test<short, uint64_t, 7, CmpOp, VSf, IDf>(cmp_ops, q);
336342
#ifdef USE_BF16
337343
passed &= test<bfloat16, int, 32, CmpOp, VSf, IDf>(cmp_ops, q);

SYCL/ESIMD/api/unary_ops_heavy.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// Exclude PVC not to run same test cases twice (via the *_pvc.cpp variant).
99
// REQUIRES: gpu && !gpu-intel-pvc
1010
// UNSUPPORTED: cuda || hip
11-
// RUN: %clangxx -fsycl %s -o %t.out
11+
// RUN: %clangxx -fsycl-device-code-split=per_kernel -fsycl %s -o %t.out
1212
// RUN: %GPU_RUN_PLACEHOLDER %t.out
1313

1414
// Tests various unary operations applied to simd objects.
@@ -174,7 +174,8 @@ int main(void) {
174174
passed &= test<half, 1>(mod_ops, q);
175175
passed &= test<half, 32>(mod_ops, q);
176176
passed &= test<float, 32>(mod_ops, q);
177-
passed &= test<double, 7>(mod_ops, q);
177+
if (dev.has(aspect::fp64))
178+
passed &= test<double, 7>(mod_ops, q);
178179

179180
auto signed_ops = esimd_test::OpSeq<UnOp, UnOp::minus, UnOp::plus>{};
180181
passed &= test<char, 7>(signed_ops, q);
@@ -183,7 +184,8 @@ int main(void) {
183184
passed &= test<int64_t, 16>(signed_ops, q);
184185
passed &= test<half, 16>(signed_ops, q);
185186
passed &= test<float, 16>(signed_ops, q);
186-
passed &= test<double, 16>(signed_ops, q);
187+
if (dev.has(aspect::fp64))
188+
passed &= test<double, 16>(signed_ops, q);
187189

188190
#ifdef USE_BF16
189191
// TODO: the rest unary operations are not yet supported for bfloat16 on host.

0 commit comments

Comments
 (0)