Skip to content

Commit ced568a

Browse files
authored
[SYCLomatic] Update nvtx related test cases for 12.9 header file only contains nvtx3 API (#2825)
Signed-off-by: Jiang, Zhiwei <zhiwei.jiang@intel.com>
1 parent 3e1326e commit ced568a

File tree

4 files changed

+52
-7
lines changed

4 files changed

+52
-7
lines changed

clang/test/dpct/NVTX/nvtx3_a.cu

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// UNSUPPORTED: cuda-8.0, cuda-9.0, cuda-9.1, cuda-9.2
2+
// RUN: dpct --format-range=none --out-root %T %s --cuda-include-path="%cuda-path/include"
3+
// RUN: FileCheck %s --match-full-lines --input-file %T/nvtx3_a.dp.cpp
4+
// RUN: %if build_lit %{icpx -c -fsycl %T/nvtx3_a.dp.cpp -o %T/nvtx3_a.dp.o %}
5+
6+
#include "nvtx3/nvToolsExt.h"
7+
#include "nvtx3/nvToolsExtCudaRt.h"
8+
9+
void foo(cudaStream_t stream) {
10+
// CHECK: /*
11+
// CHECK-NEXT: DPCT1026:{{[0-9]+}}: The call to nvtxNameCudaStreamA was removed because it annotates source code to provide contextual information to the CUDA analysis tool. Consider using Intel(R) Instrumentation and Tracing Technology (ITT) API to implement a similar function.
12+
// CHECK-NEXT: */
13+
// CHECK-NEXT: /*
14+
// CHECK-NEXT: DPCT1027:{{[0-9]+}}: The call to nvtxRangePushA was replaced with 0 because it annotates source code to provide contextual information to the CUDA analysis tool. Consider using Intel(R) Instrumentation and Tracing Technology (ITT) API to implement a similar function.
15+
// CHECK-NEXT: */
16+
// CHECK-NEXT: int a1 = 0;
17+
// CHECK-NEXT: /*
18+
// CHECK-NEXT: DPCT1027:{{[0-9]+}}: The call to nvtxRangePushW was replaced with 0 because it annotates source code to provide contextual information to the CUDA analysis tool. Consider using Intel(R) Instrumentation and Tracing Technology (ITT) API to implement a similar function.
19+
// CHECK-NEXT: */
20+
// CHECK-NEXT: int a2 = 0;
21+
// CHECK-NEXT: /*
22+
// CHECK-NEXT: DPCT1027:{{[0-9]+}}: The call to nvtxRangePop was replaced with 0 because it annotates source code to provide contextual information to the CUDA analysis tool. Consider using Intel(R) Instrumentation and Tracing Technology (ITT) API to implement a similar function.
23+
// CHECK-NEXT: */
24+
// CHECK-NEXT: int a3 = 0;
25+
nvtxNameCudaStreamA(stream, "abc");
26+
int a1 = nvtxRangePushA("abc");
27+
int a2 = nvtxRangePushW(L"abc");
28+
int a3 = nvtxRangePop();
29+
}

clang/test/dpct/NVTX/nvtx3_b.cu

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// UNSUPPORTED: cuda-8.0, cuda-9.0, cuda-9.1, cuda-9.2
2+
// RUN: dpct --format-range=none -in-root %S -out-root %T %s --cuda-include-path="%cuda-path/include" -- -std=c++14 -x cuda --cuda-host-only
3+
// RUN: FileCheck --input-file %T/nvtx3_b.dp.cpp --match-full-lines %s
4+
5+
// CHECK: #include <sycl/sycl.hpp>
6+
// CHECK: #include <dpct/dpct.hpp>
7+
#include "nvtx3/nvToolsExtCuda.h"
8+
9+
int main() {
10+
CUdevice *device;
11+
cuDeviceGet(device, 0);
12+
// CHECK: /*
13+
// CHECK-NEXT: DPCT1007:{{[0-9]+}}: Migration of nvtxNameCuDeviceA is not supported.
14+
// CHECK-NEXT: */
15+
nvtxNameCuDeviceA(*device, "nvtx_device");
16+
}

clang/test/dpct/nvtx.cu renamed to clang/test/dpct/NVTX/nvtx_a.cu

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// UNSUPPORTED: system-windows
2-
// UNSUPPORTED: cuda-12.9
3-
// RUN: dpct --format-range=none --out-root %T/nvtx %s --cuda-include-path="%cuda-path/include"
4-
// RUN: FileCheck %s --match-full-lines --input-file %T/nvtx/nvtx.dp.cpp
5-
// RUN: %if build_lit %{icpx -c -fsycl %T/nvtx/nvtx.dp.cpp -o %T/nvtx/nvtx.dp.o %}
2+
// UNSUPPORTED: cuda-8.0, cuda-9.0, cuda-9.1, cuda-9.2, cuda-12.9
3+
// RUN: dpct --format-range=none --out-root %T %s --cuda-include-path="%cuda-path/include"
4+
// RUN: FileCheck %s --match-full-lines --input-file %T/nvtx_a.dp.cpp
5+
// RUN: %if build_lit %{icpx -c -fsycl %T/nvtx_a.dp.cpp -o %T/nvtx_a.dp.o %}
66

77
#include "nvToolsExt.h"
88
#include "nvToolsExtCudaRt.h"

clang/test/dpct/NVTX/NVTX-linux.cu renamed to clang/test/dpct/NVTX/nvtx_b.cu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// UNSUPPORTED: system-windows
2-
// UNSUPPORTED: cuda-12.9
3-
// RUN: dpct --format-range=none -in-root %S -out-root %T %S/NVTX-linux.cu --cuda-include-path="%cuda-path/include" -- -std=c++14 -x cuda --cuda-host-only
4-
// RUN: FileCheck --input-file %T/NVTX-linux.dp.cpp --match-full-lines %s
2+
// UNSUPPORTED: cuda-8.0, cuda-9.0, cuda-9.1, cuda-9.2, cuda-12.9
3+
// RUN: dpct --format-range=none -in-root %S -out-root %T %s --cuda-include-path="%cuda-path/include" -- -std=c++14 -x cuda --cuda-host-only
4+
// RUN: FileCheck --input-file %T/nvtx_b.dp.cpp --match-full-lines %s
55

66
// CHECK: #include <sycl/sycl.hpp>
77
// CHECK: #include <dpct/dpct.hpp>

0 commit comments

Comments
 (0)