5
5
// RUN: cd %T
6
6
// RUN: rm -rf %T/macro_test_output
7
7
// RUN: mkdir %T/macro_test_output
8
- // RUN: dpct --no-dpcpp-extensions=free-function-queries - out-root %T/macro_test_output macro_test.cu --cuda-include-path="%cuda-path/include" -- -x cuda --cuda-host-only
8
+ // RUN: dpct -out-root %T/macro_test_output macro_test.cu --cuda-include-path="%cuda-path/include" -- -x cuda --cuda-host-only
9
9
// RUN: FileCheck --input-file %T/macro_test_output/macro_test.dp.cpp --match-full-lines macro_test.cu
10
10
// RUN: %if build_lit %{icpx -c -fsycl -DNO_BUILD_TEST %T/macro_test_output/macro_test.dp.cpp -o %T/macro_test_output/macro_test.dp.o %}
11
11
// RUN: FileCheck --input-file %T/macro_test_output/macro_test.h --match-full-lines macro_test.h
@@ -67,8 +67,8 @@ __global__ void foo_kernel() {}
67
67
// CHECK-NEXT: #ifdef MACRO_CC
68
68
// CHECK-NEXT: , int c
69
69
// CHECK-NEXT: #endif
70
- // CHECK-NEXT: , const sycl::nd_item<3> &item_ct1 ) {
71
- // CHECK-NEXT: int x = item_ct1 .get_group(2);
70
+ // CHECK-NEXT: ) {
71
+ // CHECK-NEXT: int x = sycl::ext::oneapi::this_work_item::get_nd_item<3>() .get_group(2);
72
72
// CHECK-NEXT: }
73
73
__global__ void foo_kernel2 (int a, int b
74
74
#ifdef MACRO_CC
@@ -288,7 +288,7 @@ int b;
288
288
// CHECK-NEXT: sycl::nd_range<3>(sycl::range<3>(1, 1, 2) * sycl::range<3>(1, 1, 2),
289
289
// CHECK-NEXT: sycl::range<3>(1, 1, 2)),
290
290
// CHECK-NEXT: [=](sycl::nd_item<3> item_ct1) {
291
- // CHECK-NEXT: foo_kernel2(3, 3, item_ct1 );
291
+ // CHECK-NEXT: foo_kernel2(3, 3);
292
292
// CHECK-NEXT: });
293
293
foo_kernel2<<<2 , 2 , 0 >>> (3 ,3
294
294
#ifdef MACRO_CC
@@ -435,13 +435,14 @@ FFF
435
435
436
436
}
437
437
438
- // CHECK: #define FFFFF(aaa,bbb) void foo4(const int * __restrict__ aaa, const float * __restrict__ bbb, int *c, BBB, const sycl::nd_item<3> &item_ct1, float *sp_lj, float *sp_coul, int *ljd, double la[8][1])
438
+ // CHECK: #define FFFFF(aaa,bbb) void foo4(const int * __restrict__ aaa, const float * __restrict__ bbb, int *c, BBB, float *sp_lj, float *sp_coul, int *ljd, double la[8][1])
439
439
#define FFFFF (aaa,bbb ) __device__ void foo4 (const int * __restrict__ aaa, const float * __restrict__ bbb, int *c, BBB)
440
440
441
441
// CHECK: FFFFF(pos, q)
442
442
// CHECK-NEXT: {
443
443
// CHECK-EMPTY:
444
- // CHECK-NEXT: const int tid = item_ct1.get_local_id(2);
444
+ // CHECK-NEXT: const int tid =
445
+ // CHECK-NEXT: sycl::ext::oneapi::this_work_item::get_nd_item<3>().get_local_id(2);
445
446
// CHECK-NEXT: }
446
447
FFFFF(pos, q)
447
448
{
@@ -452,13 +453,14 @@ FFFFF(pos, q)
452
453
const int tid = threadIdx .x ;
453
454
}
454
455
455
- // CHECK: #define FFFFFF(aaa,bbb) void foo5(const int * __restrict__ aaa, const float * __restrict__ bbb, const sycl::nd_item<3> &item_ct1, float *sp_lj, float *sp_coul, int *ljd, double la[8][1])
456
+ // CHECK: #define FFFFFF(aaa,bbb) void foo5(const int * __restrict__ aaa, const float * __restrict__ bbb, float *sp_lj, float *sp_coul, int *ljd, double la[8][1])
456
457
#define FFFFFF (aaa,bbb ) __device__ void foo5 (const int * __restrict__ aaa, const float * __restrict__ bbb)
457
458
458
459
// CHECK: FFFFFF(pos, q)
459
460
// CHECK-NEXT: {
460
461
// CHECK-EMPTY:
461
- // CHECK-NEXT: const int tid = item_ct1.get_local_id(2);
462
+ // CHECK-NEXT: const int tid =
463
+ // CHECK-NEXT: sycl::ext::oneapi::this_work_item::get_nd_item<3>().get_local_id(2);
462
464
// CHECK-NEXT: }
463
465
FFFFFF(pos, q)
464
466
{
@@ -483,9 +485,13 @@ __device__ void foo6(AAA, BBB)
483
485
484
486
// CHECK: #define MM __umul24
485
487
// CHECK-NEXT: #define MUL(a, b) sycl::mul24((unsigned int)a, (unsigned int)b)
486
- // CHECK-NEXT: void foo7(const sycl::nd_item<3> &item_ct1) {
487
- // CHECK-NEXT: unsigned int tid = MUL(item_ct1.get_local_range(2), item_ct1.get_group(2)) +
488
- // CHECK-NEXT: item_ct1.get_local_range(2);
488
+ // CHECK-NEXT: void foo7() {
489
+ // CHECK-NEXT: auto item_ct1 = sycl::ext::oneapi::this_work_item::get_nd_item<3>();
490
+ // CHECK-NEXT: unsigned int tid =
491
+ // CHECK-NEXT: MUL(sycl::ext::oneapi::this_work_item::get_nd_item<3>().get_local_range(
492
+ // CHECK-NEXT: 2),
493
+ // CHECK-NEXT: sycl::ext::oneapi::this_work_item::get_nd_item<3>().get_group(2)) +
494
+ // CHECK-NEXT: item_ct1.get_local_range(2);
489
495
// CHECK-NEXT: unsigned int tid2 = sycl::mul24((unsigned int)item_ct1.get_local_range(2),
490
496
// CHECK-NEXT: (unsigned int)item_ct1.get_group_range(2));
491
497
// CHECK-NEXT: }
@@ -573,7 +579,7 @@ void templatefoo2(){
573
579
CALL_KERNEL2 (8 , AAA)
574
580
}
575
581
576
- // CHECK: void foo11(const sycl::nd_item<3> &item_ct1 ){
582
+ // CHECK: void foo11(){
577
583
// CHECK-NEXT: sycl::exp((double)(THREAD_IDX_X));
578
584
// CHECK-NEXT: }
579
585
__global__ void foo11 (){
@@ -915,13 +921,14 @@ void foo20() {
915
921
}
916
922
917
923
// CHECK: #define CALLSHFLSYNC(x) \
918
- //CHECK-NEXT: dpct::select_from_sub_group(item_ct1.get_sub_group(), x, 3 ^ 1);
924
+ //CHECK-NEXT: dpct::select_from_sub_group( \
925
+ //CHECK-NEXT: sycl::ext::oneapi::this_work_item::get_sub_group(), x, 3 ^ 1);
919
926
#define CALLSHFLSYNC (x ) __shfl_sync(0xffffffff , x, 3 ^ 1 );
920
927
// CHECK: #define CALLANYSYNC(x) \
921
928
//CHECK-NEXT: sycl::any_of_group( \
922
- //CHECK-NEXT: item_ct1. get_sub_group(), \
923
- //CHECK-NEXT: (0xffffffff & \
924
- //CHECK-NEXT: (0x1 << item_ct1.get_sub_group(). get_local_linear_id())) && \
929
+ //CHECK-NEXT: sycl::ext::oneapi::this_work_item:: get_sub_group(), \
930
+ //CHECK-NEXT: (0xffffffff & (0x1 << sycl::ext::oneapi::this_work_item::get_sub_group() \
931
+ //CHECK-NEXT: . get_local_linear_id())) && \
925
932
//CHECK-NEXT: x != 0.0f);
926
933
#define CALLANYSYNC (x ) __any_sync(0xffffffff , x != 0 .0f );
927
934
@@ -964,7 +971,8 @@ foo23(void)
964
971
}
965
972
966
973
// CHECK: #define SHFL(x, y, z) \
967
- //CHECK-NEXT: dpct::select_from_sub_group(item_ct1.get_sub_group(), (x), (y), (z))
974
+ //CHECK-NEXT: dpct::select_from_sub_group( \
975
+ //CHECK-NEXT: sycl::ext::oneapi::this_work_item::get_sub_group(), (x), (y), (z))
968
976
#define SHFL (x, y, z ) __shfl ((x), (y), (z))
969
977
__global__ void foo24 (){
970
978
int i;
0 commit comments