Skip to content

Commit 7a596f9

Browse files
authored
[SYCLomatic] Add query-api-mapping for mul24 and __barrier_sync (#2915)
Signed-off-by: Jiang, Zhiwei <zhiwei.jiang@intel.com>
1 parent ff03b4a commit 7a596f9

File tree

5 files changed

+27
-0
lines changed

5 files changed

+27
-0
lines changed

clang/examples/DPCT/Math/mul24.cu

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
__global__ void test(int a, int b) {
2+
// Start
3+
mul24(a /*int*/, b /*int*/);
4+
// End
5+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
__global__ void test(unsigned id) {
2+
goto label;
3+
// Start
4+
__barrier_sync(id /*unsigned*/);
5+
// End
6+
label:
7+
int a;
8+
}

clang/test/dpct/query_api_mapping/Math/test-before12.cu

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,9 @@
66
// saturate-NEXT: saturate(f /*float*/);
77
// saturate-NEXT: Is migrated to:
88
// saturate-NEXT: dpct::clamp<float>(f, 0.0f, 1.0f);
9+
10+
// RUN: dpct --cuda-include-path="%cuda-path/include" --query-api-mapping=mul24 | FileCheck %s -check-prefix=mul24
11+
// mul24: CUDA API:
12+
// mul24-NEXT: mul24(a /*int*/, b /*int*/);
13+
// mul24-NEXT: Is migrated to:
14+
// mul24-NEXT: sycl::mul24(a, b);

clang/test/dpct/query_api_mapping/Runtime/test-after9.cu

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,9 @@
1717
// CUDALAUNCHCOOPERATIVEKERNEL-NEXT: sharedMem /*size_t*/, s /*cudaStream_t*/);
1818
// CUDALAUNCHCOOPERATIVEKERNEL-NEXT: Is migrated to:
1919
// CUDALAUNCHCOOPERATIVEKERNEL-NEXT: dpct::kernel_launcher::launch(f, gridDim, blockDim, args, sharedMem, s);
20+
21+
// RUN: dpct --cuda-include-path="%cuda-path/include" --query-api-mapping=__barrier_sync | FileCheck %s -check-prefix=__barrier_sync
22+
// __barrier_sync: CUDA API:
23+
// __barrier_sync-NEXT: __barrier_sync(id /*unsigned*/);
24+
// __barrier_sync-NEXT: Is migrated to:
25+
// __barrier_sync-NEXT: sycl::ext::oneapi::this_work_item::get_nd_item<3>().barrier();

clang/test/dpct/query_api_mapping/test_all.cu

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// CHECK-NEXT: __assertfail
1212
// CHECK-NEXT: __ballot
1313
// CHECK-NEXT: __ballot_sync
14+
// CHECK-NEXT: __barrier_sync
1415
// CHECK-NEXT: __bfloat1622float2
1516
// CHECK-NEXT: __bfloat162bfloat162
1617
// CHECK-NEXT: __bfloat162float
@@ -2296,6 +2297,7 @@
22962297
// CHECK-NEXT: min
22972298
// CHECK-NEXT: modf
22982299
// CHECK-NEXT: modff
2300+
// CHECK-NEXT: mul24
22992301
// CHECK-NEXT: nan
23002302
// CHECK-NEXT: nanf
23012303
// CHECK-NEXT: ncclAllReduce

0 commit comments

Comments
 (0)