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

Commit 2f07e69

Browse files
authored
Fix InvokeSimd simd_size and call_vadd_1d_loop_naive tests (#1602)
* Initial fix for simd_size and call_vadd_1d_loop_naive tests * Update SYCL/InvokeSimd/Spec/simd_size/simd_mismatch_error.cpp
1 parent 15afe1e commit 2f07e69

12 files changed

+55
-97
lines changed

SYCL/InvokeSimd/Regression/ImplicitSubgroup/call_vadd_1d_loop_naive.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// REQUIRES: gpu && linux
33
// UNSUPPORTED: cuda || hip
44
//
5-
// TODO: enable when Jira ticket resolved
6-
// XFAIL: gpu-intel-pvc
7-
//
85
// Check that full compilation works:
96
// RUN: %clangxx -DIMPL_SUBGROUP -fsycl -fno-sycl-device-code-split-esimd -Xclang -fsycl-allow-func-ptr %S/../call_vadd_1d_loop_naive.cpp -o %t.out
107
// RUN: env IGC_VCSaveStackCallLinkage=1 IGC_VCDirectCallsOnly=1 %GPU_RUN_PLACEHOLDER %t.out

SYCL/InvokeSimd/Regression/call_vadd_1d_loop_naive.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// REQUIRES: gpu && linux
33
// UNSUPPORTED: cuda || hip
44
//
5-
// TODO: enable when Jira ticket resolved
6-
// XFAIL: gpu-intel-pvc
7-
//
85
// Check that full compilation works:
96
// RUN: %clangxx -fsycl -fno-sycl-device-code-split-esimd -Xclang -fsycl-allow-func-ptr %s -o %t.out
107
// RUN: env IGC_VCSaveStackCallLinkage=1 IGC_VCDirectCallsOnly=1 %GPU_RUN_PLACEHOLDER %t.out

SYCL/InvokeSimd/Spec/simd_size/Inputs/common.hpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,6 @@
66
#include <iostream>
77
#include <type_traits>
88

9-
/* Subgroup size attribute is optional
10-
* In case it is absent compiler decides what subgroup size to use
11-
*/
12-
#ifdef IMPL_SUBGROUP
13-
#define SUBGROUP_ATTR
14-
#else
15-
#define SUBGROUP_ATTR [[intel::reqd_sub_group_size(VL)]]
16-
#endif
17-
189
using namespace sycl::ext::oneapi::experimental;
1910
namespace esimd = sycl::ext::intel::esimd;
2011

@@ -77,7 +68,7 @@ template <int Size, int VL, class QueueTY> bool test(QueueTY q) {
7768
try {
7869
auto e = q.submit([&](handler &cgh) {
7970
cgh.parallel_for<class TestID<Size, VL>>(
80-
Range, [=](nd_item<1> ndi) SUBGROUP_ATTR {
71+
Range, [=](nd_item<1> ndi) [[intel::reqd_sub_group_size(VL)]] {
8172
sub_group sg = ndi.get_sub_group();
8273
group<1> g = ndi.get_group();
8374
uint32_t i = sg.get_group_linear_id() * VL +

SYCL/InvokeSimd/Spec/simd_size/simd16.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// REQUIRES: gpu && linux
33
// UNSUPPORTED: cuda || hip
44
//
5-
// TODO: enable when Jira ticket resolved
6-
// XFAIL: gpu
7-
//
85
// Check that full compilation works:
96
// RUN: %clangxx -fsycl -fno-sycl-device-code-split-esimd -Xclang -fsycl-allow-func-ptr %s -o %t.out
107
// RUN: env IGC_VCSaveStackCallLinkage=1 IGC_VCDirectCallsOnly=1 %GPU_RUN_PLACEHOLDER %t.out
@@ -32,11 +29,7 @@ int main(void) {
3229
bool passed = true;
3330

3431
// simd_size 16
35-
passed &= test<4, 16>(q);
36-
passed &= test<8, 16>(q);
3732
passed &= test<16, 16>(q);
38-
passed &= test<32, 16>(q);
39-
// TODO FIXME: enable cases with ret val size > 32 when Jira ticket resolved
4033

4134
std::cout << (passed ? "Passed\n" : "FAILED\n");
4235
return passed ? 0 : 1;

SYCL/InvokeSimd/Spec/simd_size/simd16_ImplicitSubgroup.cpp

Lines changed: 0 additions & 19 deletions
This file was deleted.

SYCL/InvokeSimd/Spec/simd_size/simd32.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
// REQUIRES: gpu-intel-pvc && linux
44
// UNSUPPORTED: cuda || hip
55
//
6-
// TODO: enable when Jira ticket resolved
7-
// XFAIL: gpu
8-
//
96
// Check that full compilation works:
107
// RUN: %clangxx -fsycl -fno-sycl-device-code-split-esimd -Xclang -fsycl-allow-func-ptr %s -o %t.out
118
// RUN: env IGC_VCSaveStackCallLinkage=1 IGC_VCDirectCallsOnly=1 %GPU_RUN_PLACEHOLDER %t.out
@@ -32,11 +29,7 @@ int main(void) {
3229
bool passed = true;
3330

3431
// simd_size 32
35-
passed &= test<4, 32>(q);
36-
passed &= test<8, 32>(q);
37-
passed &= test<16, 32>(q);
3832
passed &= test<32, 32>(q);
39-
// TODO FIXME: enable cases with ret val size > 32 when Jira ticket resolved
4033

4134
std::cout << (passed ? "Passed\n" : "FAILED\n");
4235
return passed ? 0 : 1;

SYCL/InvokeSimd/Spec/simd_size/simd32_ImplicitSubgroup.cpp

Lines changed: 0 additions & 20 deletions
This file was deleted.

SYCL/InvokeSimd/Spec/simd_size/simd8.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
// Test not intended to run on PVC
55
// UNSUPPORTED: cuda || hip || gpu-intel-pvc
66
//
7-
// TODO: enable when Jira ticket resolved
8-
// XFAIL: gpu
9-
//
107
// Check that full compilation works:
118
// RUN: %clangxx -fsycl -fno-sycl-device-code-split-esimd -Xclang -fsycl-allow-func-ptr %s -o %t.out
129
// RUN: env IGC_VCSaveStackCallLinkage=1 IGC_VCDirectCallsOnly=1 %GPU_RUN_PLACEHOLDER %t.out
@@ -33,11 +30,7 @@ int main(void) {
3330
bool passed = true;
3431

3532
// simd_size 8
36-
passed &= test<4, 8>(q);
3733
passed &= test<8, 8>(q);
38-
passed &= test<16, 8>(q);
39-
passed &= test<32, 8>(q);
40-
// TODO FIXME: enable cases with ret val size > 32 when Jira ticket resolved
4134

4235
std::cout << (passed ? "Passed\n" : "FAILED\n");
4336
return passed ? 0 : 1;

SYCL/InvokeSimd/Spec/simd_size/simd8_ImplicitSubgroup.cpp

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// TODO: enable on Windows once driver is ready
2+
// REQUIRES: gpu && linux
3+
// UNSUPPORTED: cuda || hip
4+
//
5+
// TODO: enable when Jira ticket resolved
6+
// XFAIL: gpu
7+
//
8+
// Check that full compilation works:
9+
// RUN: %clangxx -fsycl -fno-sycl-device-code-split-esimd -Xclang -fsycl-allow-func-ptr %s -o %t.out | FileCheck %s
10+
11+
/* Tests invoke_simd support in the compiler/headers
12+
* The test checks that compiler emits a meaningful and user friendly error message
13+
* when the target function of invoke_simd has arguments or returns of simd<T,N> or
14+
* simd_mask<T,N> type and N is not equal to subgroup size.
15+
*/
16+
17+
#include "Inputs/common.hpp"
18+
19+
int main(void) {
20+
auto q = queue{gpu_selector_v};
21+
auto dev = q.get_device();
22+
std::cout << "Running on " << dev.get_info<sycl::info::device::name>()
23+
<< "\n";
24+
bool passed = true;
25+
26+
// TODO: exact error message is a subject to future changes
27+
28+
// simd_size 8
29+
passed &= test<4, 8>(q);
30+
// CHECK: {{.*}}error: Kernel subgroup size (8) does not match size of invoke_simd return type (4){{.*}}
31+
passed &= test<16, 8>(q);
32+
// CHECK: {{.*}}error: Kernel subgroup size (8) does not match size of invoke_simd return type (16){{.*}}
33+
passed &= test<32, 8>(q);
34+
// CHECK: {{.*}}error: Kernel subgroup size (8) does not match size of invoke_simd return type (32){{.*}}
35+
36+
// simd_size 16
37+
passed &= test<4, 16>(q);
38+
// CHECK: {{.*}}error: Kernel subgroup size (16) does not match size of invoke_simd return type (4){{.*}}
39+
passed &= test<8, 16>(q);
40+
// CHECK: {{.*}}error: Kernel subgroup size (16) does not match size of invoke_simd return type (8){{.*}}
41+
passed &= test<32, 16>(q);
42+
// CHECK: {{.*}}error: Kernel subgroup size (16) does not match size of invoke_simd return type (32){{.*}}
43+
44+
// simd_size 32
45+
passed &= test<4, 32>(q);
46+
// CHECK: {{.*}}error: Kernel subgroup size (32) does not match size of invoke_simd return type (4){{.*}}
47+
passed &= test<8, 32>(q);
48+
// CHECK: {{.*}}error: Kernel subgroup size (32) does not match size of invoke_simd return type (8){{.*}}
49+
passed &= test<16, 32>(q);
50+
// CHECK: {{.*}}error: Kernel subgroup size (32) does not match size of invoke_simd return type (16){{.*}}
51+
52+
std::cout << (passed ? "Passed\n" : "FAILED\n");
53+
return passed ? 0 : 1;
54+
}

0 commit comments

Comments
 (0)