Skip to content

Commit

Permalink
[SYCLomatic] Enable build lit
Browse files Browse the repository at this point in the history
Signed-off-by: Chen, Sheng S <sheng.s.chen@intel.com>
  • Loading branch information
ShengchenJ committed Dec 26, 2023
1 parent d963089 commit 06886c8
Show file tree
Hide file tree
Showing 95 changed files with 299 additions and 158 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci_lin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@ jobs:
rm -rf tools/clang/test/dpct
CUDA_PATH=$CUDAROOT/cuda-11.8 ninja check-clang-c2s
- name: BUILD_LIT
if: |
steps.Echo-Build-Success.outputs.build_success == 'true'
run: |
cd c2s.src/build
rm -rf tools/clang/test/dpct
BUILD_LIT=TRUE ninja check-clang-c2s
linux-test:
name: linux-test-${{ matrix.test_suite }}-cpu
runs-on: test
Expand Down
5 changes: 3 additions & 2 deletions clang/test/dpct/USM-restricted.cu
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// UNSUPPORTED: system-windows
// RUN: dpct --format-range=none --usm-level=restricted -out-root %T/USM-restricted %s --cuda-include-path="%cuda-path/include" -- -std=c++14 -x cuda --cuda-host-only
// RUN: FileCheck --match-full-lines --input-file %T/USM-restricted/USM-restricted.dp.cpp %s
// RUN: %if build_lit %{icpx -c -fsycl %T/USM-restricted/USM-restricted.dp.cpp -o %T/USM-restricted/USM-restricted.dp.o %}

// RUN: %if build_lit %{icpx -c -fsycl -DBUILD_TEST %T/USM-restricted/USM-restricted.dp.cpp -o %T/USM-restricted/USM-restricted.dp.o %}
#ifndef BUILD_TEST
// CHECK: #include <sycl/sycl.hpp>
// CHECK-NEXT: #include <dpct/dpct.hpp>
#include <cuda_runtime.h>
Expand Down Expand Up @@ -1089,3 +1089,4 @@ int foo17() {
cudaMemcpy(d_in_data_2, h_data, mem_size, cudaMemcpyHostToDevice);
return 0;
}
#endif
4 changes: 2 additions & 2 deletions clang/test/dpct/asm/vabsdiff2.cu
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: dpct --format-range=none -out-root %T/asm/vabsdiff2 %s --cuda-include-path="%cuda-path/include" -- -std=c++14 -x cuda --cuda-host-only
// RUN: FileCheck %s --match-full-lines --input-file %T/asm/vabsdiff2/vabsdiff2.dp.cpp
// RUN: %if build_lit %{icpx -c -fsycl %T/vabsdiff2/vabsdiff2.dp.cpp -o %T/vabsdiff2/vabsdiff2.dp.o %}
// RUN: %if build_lit %{icpx -c -fsycl %T/asm/vabsdiff2/vabsdiff2.dp.cpp -o %T/asm/vabsdiff2/vabsdiff2.dp.o %}

__global__ void vabsdiff2() {
int a, b, c, d;
Expand All @@ -18,4 +18,4 @@ __global__ void vabsdiff2() {
int main() {
vabsdiff2<<<1, 1>>>();
return 0;
}
}
2 changes: 1 addition & 1 deletion clang/test/dpct/asm/vabsdiff4.cu
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: dpct --format-range=none -out-root %T/asm/vabsdiff4 %s --cuda-include-path="%cuda-path/include" -- -std=c++14 -x cuda --cuda-host-only
// RUN: FileCheck %s --match-full-lines --input-file %T/asm/vabsdiff4/vabsdiff4.dp.cpp
// RUN: %if build_lit %{icpx -c -fsycl %T/vabsdiff4/vabsdiff4.dp.cpp -o %T/vabsdiff4/vabsdiff4.dp.o %}
// RUN: %if build_lit %{icpx -c -fsycl %T/asm/vabsdiff4/vabsdiff4.dp.cpp -o %T/asm/vabsdiff4/vabsdiff4.dp.o %}

__global__ void vabsdiff4() {
int a, b, c, d;
Expand Down
4 changes: 2 additions & 2 deletions clang/test/dpct/asm/vadd2.cu
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: dpct --format-range=none -out-root %T/asm/vadd2 %s --cuda-include-path="%cuda-path/include" -- -std=c++14 -x cuda --cuda-host-only
// RUN: FileCheck %s --match-full-lines --input-file %T/asm/vadd2/vadd2.dp.cpp
// RUN: %if build_lit %{icpx -c -fsycl %T/vadd2/vadd2.dp.cpp -o %T/vadd2/vadd2.dp.o %}
// RUN: %if build_lit %{icpx -c -fsycl %T/asm/vadd2/vadd2.dp.cpp -o %T/asm/vadd2/vadd2.dp.o %}

__global__ void vadd2() {
int a, b, c, d;
Expand All @@ -18,4 +18,4 @@ __global__ void vadd2() {
int main() {
vadd2<<<1, 1>>>();
return 0;
}
}
2 changes: 1 addition & 1 deletion clang/test/dpct/asm/vadd4.cu
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: dpct --format-range=none -out-root %T/asm/vadd4 %s --cuda-include-path="%cuda-path/include" -- -std=c++14 -x cuda --cuda-host-only
// RUN: FileCheck %s --match-full-lines --input-file %T/asm/vadd4/vadd4.dp.cpp
// RUN: %if build_lit %{icpx -c -fsycl %T/vadd4/vadd4.dp.cpp -o %T/vadd4/vadd4.dp.o %}
// RUN: %if build_lit %{icpx -c -fsycl %T/asm/vadd4/vadd4.dp.cpp -o %T/asm/vadd4/vadd4.dp.o %}

__global__ void vadd4() {
int a, b, c, d;
Expand Down
2 changes: 1 addition & 1 deletion clang/test/dpct/asm/vmax2.cu
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: dpct --format-range=none -out-root %T/asm/vmax2 %s --cuda-include-path="%cuda-path/include" -- -std=c++14 -x cuda --cuda-host-only
// RUN: FileCheck %s --match-full-lines --input-file %T/asm/vmax2/vmax2.dp.cpp
// RUN: %if build_lit %{icpx -c -fsycl %T/vmax2/vmax2.dp.cpp -o %T/vmax2/vmax2.dp.o %}
// RUN: %if build_lit %{icpx -c -fsycl %T/asm/vmax2/vmax2.dp.cpp -o %T/asm/vmax2/vmax2.dp.o %}

__global__ void vmax2() {
int a, b, c, d;
Expand Down
2 changes: 1 addition & 1 deletion clang/test/dpct/asm/vmax4.cu
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: dpct --format-range=none -out-root %T/asm/vmax4 %s --cuda-include-path="%cuda-path/include" -- -std=c++14 -x cuda --cuda-host-only
// RUN: FileCheck %s --match-full-lines --input-file %T/asm/vmax4/vmax4.dp.cpp
// RUN: %if build_lit %{icpx -c -fsycl %T/vmax4/vmax4.dp.cpp -o %T/vmax4/vmax4.dp.o %}
// RUN: %if build_lit %{icpx -c -fsycl %T/asm/vmax4/vmax4.dp.cpp -o %T/asm/vmax4/vmax4.dp.o %}

__global__ void vmax4() {
int a, b, c, d;
Expand Down
2 changes: 1 addition & 1 deletion clang/test/dpct/asm/vmin2.cu
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: dpct --format-range=none -out-root %T/asm/vmin2 %s --cuda-include-path="%cuda-path/include" -- -std=c++14 -x cuda --cuda-host-only
// RUN: FileCheck %s --match-full-lines --input-file %T/asm/vmin2/vmin2.dp.cpp
// RUN: %if build_lit %{icpx -c -fsycl %T/vmin2/vmin2.dp.cpp -o %T/vmin2/vmin2.dp.o %}
// RUN: %if build_lit %{icpx -c -fsycl %T/asm/vmin2/vmin2.dp.cpp -o %T/asm/vmin2/vmin2.dp.o %}

__global__ void vmin2() {
int a, b, c, d;
Expand Down
2 changes: 1 addition & 1 deletion clang/test/dpct/asm/vmin4.cu
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: dpct --format-range=none -out-root %T/asm/vmin4 %s --cuda-include-path="%cuda-path/include" -- -std=c++14 -x cuda --cuda-host-only
// RUN: FileCheck %s --match-full-lines --input-file %T/asm/vmin4/vmin4.dp.cpp
// RUN: %if build_lit %{icpx -c -fsycl %T/vmin4/vmin4.dp.cpp -o %T/vmin4/vmin4.dp.o %}
// RUN: %if build_lit %{icpx -c -fsycl %T/asm/vmin4/vmin4.dp.cpp -o %T/asm/vmin4/vmin4.dp.o %}

__global__ void vmin4() {
int a, b, c, d;
Expand Down
3 changes: 1 addition & 2 deletions clang/test/dpct/asm/vsub2.cu
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// RUN: dpct --format-range=none -out-root %T/asm/vsub2 %s --cuda-include-path="%cuda-path/include" -- -std=c++14 -x cuda --cuda-host-only
// RUN: FileCheck %s --match-full-lines --input-file %T/asm/vsub2/vsub2.dp.cpp
// RUN: %if build_lit %{icpx -c -fsycl %T/vsub2/vsub2.dp.cpp -o %T/vsub2/vsub2.dp.o %}

// RUN: %if build_lit %{icpx -c -fsycl %T/asm/vsub2/vsub2.dp.cpp -o %T/asm/vsub2/vsub2.dp.o %}
__global__ void vsub2() {
int a, b, c, d;

Expand Down
2 changes: 1 addition & 1 deletion clang/test/dpct/asm/vsub4.cu
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: dpct --format-range=none -out-root %T/asm/vsub4 %s --cuda-include-path="%cuda-path/include" -- -std=c++14 -x cuda --cuda-host-only
// RUN: FileCheck %s --match-full-lines --input-file %T/asm/vsub4/vsub4.dp.cpp
// RUN: %if build_lit %{icpx -c -fsycl %T/vsub4/vsub4.dp.cpp -o %T/vsub4/vsub4.dp.o %}
// RUN: %if build_lit %{icpx -c -fsycl %T/asm/vsub4/vsub4.dp.cpp -o %T/asm/vsub4/vsub4.dp.o %}

__global__ void vsub4() {
int a, b, c, d;
Expand Down
7 changes: 5 additions & 2 deletions clang/test/dpct/c_feature_file.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// RUN: dpct --format-range=none -out-root %T/c_feature_file %s --cuda-include-path="%cuda-path/include" --stop-on-parse-err --extra-arg="-xc"
// RUN: FileCheck %s --match-full-lines --input-file %T/c_feature_file/c_feature_file.c.dp.cpp
// RUN: %if build_lit %{icpx -c -fsycl %T/c_feature_file/c_feature_file.c.dp.cpp -o %T/c_feature_file/c_feature_file.c.dp.o %}
// RUN: %if build_lit %{icpx -c -fsycl -DBUILD_TEST %T/c_feature_file/c_feature_file.c.dp.cpp -o %T/c_feature_file/c_feature_file.c.dp.o %}

#ifndef BUILD_TEST

//CHECK:#include <sycl/sycl.hpp>
//CHECK:#include <dpct/dpct.hpp>
Expand All @@ -17,4 +19,5 @@ int main(int argc, char** argv) {

func(N, a);
return 0;
}
}
#endif
6 changes: 4 additions & 2 deletions clang/test/dpct/c_feature_file_db.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
// RUN: echo "]" >> compile_commands.json
// RUN: dpct -p=. --out-root=./out --cuda-include-path="%cuda-path/include" --stop-on-parse-err --extra-arg="-xc" --extra-arg="-I%cuda-path/include"
// RUN: FileCheck %s --match-full-lines --input-file %T/c_feature_file_db/out/c_feature_file_db.c.dp.cpp
// RUN: %if build_lit %{icpx -c -fsycl %T/c_feature_file_db/out/c_feature_file_db.c.dp.cpp -o %T/c_feature_file_db/out/c_feature_file_db.c.dp.o %}
// RUN: %if build_lit %{icpx -c -fsycl -DBUILD_TEST %T/c_feature_file_db/out/c_feature_file_db.c.dp.cpp -o %T/c_feature_file_db/out/c_feature_file_db.c.dp.o %}
// RUN: cd ..
// RUN: rm -rf ./c_feature_file_db

#ifndef BUILD_TEST
//CHECK:#include <sycl/sycl.hpp>
//CHECK:#include <dpct/dpct.hpp>
#include "cuda_runtime.h"
Expand All @@ -31,4 +32,5 @@ int main(int argc, char** argv) {

func(N, a);
return 0;
}
}
#endif
4 changes: 2 additions & 2 deletions clang/test/dpct/change_file_in_incrementa_migration/test.cu
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: cp %S/* .
// RUN: dpct --process-all --in-root=. --out-root=%T --cuda-include-path="%cuda-path/include" -- -DAAA
// RUN: FileCheck --input-file %T/test.dp.cpp --match-full-lines %S/migrate_ref1.txt
// RUN: %if build_lit %{icpx -c -fsycl %T/test.dp.cpp -o %T/test.dp.o %}
// RUN: %if build_lit %{icpx -c -fsycl %T/test.dp.cpp -DAAA -o %T/test.dp.o %}
// RUN: echo "//" >> test.cu
// RUN: dpct --process-all --in-root=. --out-root=%T 2> %T/output1.txt --cuda-include-path="%cuda-path/include"
// RUN: FileCheck --input-file %T/test.dp.cpp --match-full-lines %S/migrate_ref2.txt
Expand All @@ -10,7 +10,7 @@
// RUN: echo "//" >> test.cuh
// RUN: dpct --process-all --in-root=. --out-root=%T 2> %T/output2.txt --cuda-include-path="%cuda-path/include" -- -DAAA
// RUN: FileCheck --input-file %T/test.dp.cpp --match-full-lines %S/migrate_ref3.txt
// RUN: %if build_lit %{icpx -c -fsycl %T/test.dp.cpp -o %T/test.dp.o %}
// RUN: %if build_lit %{icpx -c -fsycl %T/test.dp.cpp -DAAA -o %T/test.dp.o %}
// RUN: FileCheck --input-file %T/output2.txt --match-full-lines %S/output_ref2.txt
// RUN: rm -rf %T/*

Expand Down
6 changes: 4 additions & 2 deletions clang/test/dpct/checkFormatMigrated.cu
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
// RUN: cd %T
// RUN: dpct --no-cl-namespace-inline -out-root %T/checkFormatMigrated checkFormatMigrated.cu --cuda-include-path="%cuda-path/include" -- -std=c++14 -x cuda --cuda-host-only
// RUN: FileCheck -strict-whitespace checkFormatMigrated.cu --match-full-lines --input-file %T/checkFormatMigrated/checkFormatMigrated.dp.cpp
// RUN: %if build_lit %{icpx -c -fsycl %T/checkFormatMigrated/checkFormatMigrated.dp.cpp -o %T/checkFormatMigrated/checkFormatMigrated.dp.o %}
// RUN: %if build_lit %{icpx -c -fsycl -DBUILD_TEST %T/checkFormatMigrated/checkFormatMigrated.dp.cpp -o %T/checkFormatMigrated/checkFormatMigrated.dp.o %}

#ifndef BUILD_TEST
#include <cuda_runtime.h>
#include <cassert>
#include <cstdio>
Expand Down Expand Up @@ -348,4 +349,5 @@ __global__ void foo13() {
n.y = m.z;
n.z = m.y;
n.w = m.x;
}
}
#endif
7 changes: 5 additions & 2 deletions clang/test/dpct/checkKernelFormatMigrated.cu
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
// RUN: cd %T
// RUN: dpct --no-cl-namespace-inline -out-root %T/checkKernelFormatMigrated checkKernelFormatMigrated.cu --cuda-include-path="%cuda-path/include" -- -std=c++14 -x cuda --cuda-host-only
// RUN: FileCheck -strict-whitespace checkKernelFormatMigrated.cu --match-full-lines --input-file %T/checkKernelFormatMigrated/checkKernelFormatMigrated.dp.cpp
// RUN: %if build_lit %{icpx -c -fsycl %T/checkKernelFormatMigrated/checkKernelFormatMigrated.dp.cpp -o %T/checkKernelFormatMigrated/checkKernelFormatMigrated.dp.o %}
// RUN: %if build_lit %{icpx -c -fsycl -DBUILD_TEST %T/checkKernelFormatMigrated/checkKernelFormatMigrated.dp.cpp -o %T/checkKernelFormatMigrated/checkKernelFormatMigrated.dp.o %}

#ifndef BUILD_TEST

#include <cuda_runtime.h>

Expand Down Expand Up @@ -67,4 +69,5 @@ void foo4() {
for (;;) {
k<<<1, 1>>>();
}
}
}
#endif
4 changes: 3 additions & 1 deletion clang/test/dpct/clock.cu
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// RUN: dpct --format-range=none -out-root %T/clock %s --cuda-include-path="%cuda-path/include" -- -std=c++14 -x cuda --cuda-host-only
// RUN: FileCheck %s --match-full-lines --input-file %T/clock/clock.dp.cpp
// RUN: %if build_lit %{icpx -c -fsycl %T/clock/clock.dp.cpp -o %T/clock/clock.dp.o %}
// RUN: %if build_lit %{icpx -c -fsycl -DBUILD_TEST %T/clock/clock.dp.cpp -o %T/clock/clock.dp.o %}

#ifndef BUILD_TEST
// CHECK: #include <stdint.h>
// CHECK-NEXT: #include <stdio.h>
// CHECK-NEXT: #include <time.h>
Expand Down Expand Up @@ -51,3 +52,4 @@ int main(int argc, char **argv) {
timedAddition(hinput, houtput, htimer);
return 0;
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

// RUN: dpct --format-range=none -in-root=%T -out-root=%T/out case_not_in_db.c case_in_db.c --format-range=none --cuda-include-path="%cuda-path/include"
// RUN: FileCheck %T/case_not_in_db.c --match-full-lines --input-file %T/out/case_not_in_db.c.dp.cpp
// RUN: %if build_lit %{icpx -c -fsycl %T/out/case_not_in_db.c.dp.cpp -o %T/out/case_not_in_db.c.dp.o %}
// RUN: %if build_lit %{icpx -c -fsycl %T/out/case_not_in_db.c.dp.cpp -o %T/out/case_not_in_db.c.dp.o %}
// RUN: FileCheck %T/case_in_db.c --match-full-lines --input-file %T/out/case_in_db.c.dp.cpp
// RUN: %if build_lit %{icpx -c -fsycl %T/out/case_in_db.c.dp.cpp -o %T/out/case_in_db.c.dp.o %}
// RUN: %if build_lit %{icpx -c -fsycl -DTEST %T/out/case_in_db.c.dp.cpp -o %T/out/case_in_db.c.dp.o %}


// CHECK: #include <sycl/sycl.hpp>
Expand All @@ -23,4 +23,4 @@ __global__ void simple_kernel(float *d_array) {
}
#else
__constant__ float const_angle[240];
#endif
#endif
5 changes: 3 additions & 2 deletions clang/test/dpct/conflict-resolution.cu
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// RUN: dpct --format-range=none -out-root %T/conflict-resolution %s -passes "ErrorHandlingIfStmtRule,ErrorConstantsRule" --cuda-include-path="%cuda-path/include" -- -x cuda --cuda-host-only
// RUN: FileCheck %s --match-full-lines --input-file %T/conflict-resolution/conflict-resolution.dp.cpp
// RUN: %if build_lit %{icpx -c -fsycl %T/conflict-resolution/conflict-resolution.dp.cpp -o %T/conflict-resolution/conflict-resolution.dp.o %}
// RUN: %if build_lit %{icpx -c -fsycl -DBUILD_TEST %T/conflict-resolution/conflict-resolution.dp.cpp -o %T/conflict-resolution/conflict-resolution.dp.o %}

#ifndef BUILD_TEST
int printf(const char *format, ...);

// CHECK: void test_00(cudaError_t err) {
Expand All @@ -13,4 +14,4 @@ void test_00(cudaError_t err) {
exit(1);
}
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// UNSUPPORTED: v8.0, v9.0, v9.1, v9.2, v10.0, v10.1, v10.2
// RUN: dpct --format-range=none -in-root %S -out-root %T/devicelevel/device_inclusive_scan_by_key %S/device_inclusive_scan_by_key.cu --cuda-include-path="%cuda-path/include" -- -std=c++14 -x cuda --cuda-host-only
// RUN: FileCheck --input-file %T/devicelevel/device_inclusive_scan_by_key/device_inclusive_scan_by_key.dp.cpp %s
// RUN: %if build_lit %{icpx -c -fsycl %T/devicelevel/device_inclusive_scan_by_key/device_inclusive_scan_by_key.dp.cpp -o %T/devicelevel/device_inclusive_scan_by_key/device_inclusive_scan_by_key.dp.o %}

// RUN: %if build_lit %{icpx -c -fsycl -DBUILD_TEST %T/devicelevel/device_inclusive_scan_by_key/device_inclusive_scan_by_key.dp.cpp -o %T/devicelevel/device_inclusive_scan_by_key/device_inclusive_scan_by_key.dp.o %}
#ifndef BUILD_TEST
// CHECK:#include <oneapi/dpl/execution>
// CHECK:#include <oneapi/dpl/algorithm>
#include <cub/cub.cuh>
Expand Down Expand Up @@ -94,3 +94,4 @@ void test6() {
cub::DeviceScan::InclusiveScanByKey(temp_storage, temp_storage_size, d_key, d_input,d_output, cub::Max(), num_items, cub::Equality(), stream);
cudaFree(temp_storage);
}
#endif
6 changes: 4 additions & 2 deletions clang/test/dpct/cub/type/arg_index_iterator.cu
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
// UNSUPPORTED: v8.0, v9.0, v9.1, v9.2, v10.0, v10.1, v10.2
// RUN: dpct --format-range=none -in-root %S -out-root %T/type/arg_index_iterator %S/arg_index_iterator.cu --cuda-include-path="%cuda-path/include" -- -std=c++14 -x cuda --cuda-host-only
// RUN: FileCheck --input-file %T/type/arg_index_iterator/arg_index_iterator.dp.cpp %s
// RUN: %if build_lit %{icpx -c -fsycl %T/type/arg_index_iterator/arg_index_iterator.dp.cpp -o %T/type/arg_index_iterator/arg_index_iterator.dp.o %}
// RUN: %if build_lit %{icpx -c -fsycl -DBUILD_TEST %T/type/arg_index_iterator/arg_index_iterator.dp.cpp -o %T/type/arg_index_iterator/arg_index_iterator.dp.o %}


#ifndef BUILD_TEST
// CHECK: #include <dpct/dpl_utils.hpp>
#include <cub/cub.cuh>
#include <iostream>
Expand Down Expand Up @@ -78,4 +80,4 @@ void test10(void) {
// CHECK: Iter = Iter.create_normalize();
Iter.normalize();
}

#endif
7 changes: 5 additions & 2 deletions clang/test/dpct/cublas-lambda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
// RUN: cd %T
// RUN: dpct --no-cl-namespace-inline --usm-level=none -out-root %T/cublas-lambda cublas-lambda.cu --cuda-include-path="%cuda-path/include" -- -x cuda --cuda-host-only
// RUN: FileCheck --input-file %T/cublas-lambda/cublas-lambda.dp.cpp --match-full-lines cublas-lambda.cu
// RUN: %if build_lit %{icpx -c -fsycl %T/cublas-lambda/cublas-lambda.dp.cpp -o %T/cublas-lambda/cublas-lambda.dp.o %}
// RUN: %if build_lit %{icpx -c -fsycl -DBUILD_TEST %T/cublas-lambda/cublas-lambda.dp.cpp -o %T/cublas-lambda/cublas-lambda.dp.o %}

#ifndef BUILD_TEST
// CHECK: #include <sycl/sycl.hpp>
// CHECK-NEXT: #include <dpct/dpct.hpp>
// CHECK-NEXT: #include <cstdio>
Expand Down Expand Up @@ -212,4 +214,5 @@ int foo() {
// CHECK-NEXT:}
void foo2() {
cublasHgemm(handle, CUBLAS_OP_N, CUBLAS_OP_N, N, N, N, &alpha_H, d_A_H, N, d_B_H, N, &beta_H, d_C_H, N);
}
}
#endif
6 changes: 4 additions & 2 deletions clang/test/dpct/cublasLegacyHelper.cu
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// RUN: dpct --no-cl-namespace-inline --format-range=none --usm-level=none -out-root %T/cublasLegacyHelper %s --cuda-include-path="%cuda-path/include" -- -x cuda --cuda-host-only
// RUN: FileCheck --input-file %T/cublasLegacyHelper/cublasLegacyHelper.dp.cpp --match-full-lines %s
// RUN: %if build_lit %{icpx -c -fsycl %T/cublasLegacyHelper/cublasLegacyHelper.dp.cpp -o %T/cublasLegacyHelper/cublasLegacyHelper.dp.o %}
// RUN: %if build_lit %{icpx -c -fsycl -DBUILD_TEST %T/cublasLegacyHelper/cublasLegacyHelper.dp.cpp -o %T/cublasLegacyHelper/cublasLegacyHelper.dp.o %}

#ifndef BUILD_TEST
// CHECK: #include <sycl/sycl.hpp>
// CHECK-NEXT: #include <dpct/dpct.hpp>
// CHECK-NEXT: #include <cstdio>
Expand Down Expand Up @@ -161,4 +163,4 @@ int main() {
cublasShutdown();
return 0;
}

#endif
4 changes: 3 additions & 1 deletion clang/test/dpct/cuda-event-api-enable-profiling.cu
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// RUN: dpct --enable-profiling --format-range=none --usm-level=none -out-root %T/cuda-event-api-enable-profiling %s --cuda-include-path="%cuda-path/include" --sycl-named-lambda -- -std=c++14 -x cuda --cuda-host-only
// RUN: FileCheck --input-file %T/cuda-event-api-enable-profiling/cuda-event-api-enable-profiling.dp.cpp --match-full-lines %s
// RUN: %if build_lit %{icpx -c -fsycl %T/cuda-event-api-enable-profiling/cuda-event-api-enable-profiling.dp.cpp -o %T/cuda-event-api-enable-profiling/cuda-event-api-enable-profiling.dp.o %}
// RUN: %if build_lit %{icpx -c -fsycl -DBUILD_TEST %T/cuda-event-api-enable-profiling/cuda-event-api-enable-profiling.dp.cpp -o %T/cuda-event-api-enable-profiling/cuda-event-api-enable-profiling.dp.o %}

#ifndef BUILD_TEST
// CHECK:#define DPCT_PROFILING_ENABLED
// CHECK-NEXT: #define DPCT_USM_LEVEL_NONE
// CHECK-NEXT: #include <sycl/sycl.hpp>
Expand Down Expand Up @@ -345,3 +346,4 @@ void foo2(Node *n) {
cudaEventRecord(n->p_events[3]);
}
}
#endif
5 changes: 3 additions & 2 deletions clang/test/dpct/cuda-stream-api.cu
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
// UNSUPPORTED: system-windows
// RUN: dpct --usm-level=none -out-root %T/cuda-stream-api %s --cuda-include-path="%cuda-path/include" --sycl-named-lambda -- -std=c++14 -x cuda --cuda-host-only
// RUN: FileCheck --input-file %T/cuda-stream-api/cuda-stream-api.dp.cpp --match-full-lines %s
// RUN: %if build_lit %{icpx -c -fsycl %T/cuda-stream-api/cuda-stream-api.dp.cpp -o %T/cuda-stream-api/cuda-stream-api.dp.o %}
// RUN: %if build_lit %{icpx -c -fsycl -DBUILD_TEST %T/cuda-stream-api/cuda-stream-api.dp.cpp -o %T/cuda-stream-api/cuda-stream-api.dp.o %}

#ifndef BUILD_TEST
#include <list>
#include <functional>

Expand Down Expand Up @@ -326,4 +327,4 @@ class C {
streams2 = INIT_STREAM;
}
};

#endif
2 changes: 1 addition & 1 deletion clang/test/dpct/cuda_arch_lang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// RUN: python3 -c "assert 'no CUDA code detected' in input()" < %T/cuda_arch_lang/output
// RUN: dpct --format-range=none --out-root=%T/cuda_arch_lang --cuda-include-path="%cuda-path/include" %s -- -x cuda
// RUN: FileCheck --input-file=%T/cuda_arch_lang/cuda_arch_lang.cpp.dp.cpp %s
// RUN: %if build_lit %{icpx -c -fsycl --input-file=%T/cuda_arch_lang/cuda_arch_lang.cpp.dp.cpp -o --input-file=%T/cuda_arch_lang/cuda_arch_lang.o.dp.o %}
// RUN: %if build_lit %{icpx -c -fsycl -DBUILD_TEST %T/cuda_arch_lang/cuda_arch_lang.cpp.dp.cpp -o %T/cuda_arch_lang/cuda_arch_lang.o.dp.o %}

// CHECK: #ifdef DPCT_COMPATIBILITY_TEMP
#ifdef __CUDA_ARCH__
Expand Down
5 changes: 3 additions & 2 deletions clang/test/dpct/cuda_cache_config.cu
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// RUN: dpct --format-range=none --usm-level=none -out-root %T/cuda_cache_config %s --cuda-include-path="%cuda-path/include" --sycl-named-lambda -- -x cuda --cuda-host-only
// RUN: FileCheck %s --match-full-lines --input-file %T/cuda_cache_config/cuda_cache_config.dp.cpp
// RUN: %if build_lit %{icpx -c -fsycl %T/cuda_cache_config/cuda_cache_config.dp.cpp -o %T/cuda_cache_config/cuda_cache_config.dp.o %}
// RUN: %if build_lit %{icpx -c -fsycl -DBUILD_TEST %T/cuda_cache_config/cuda_cache_config.dp.cpp -o %T/cuda_cache_config/cuda_cache_config.dp.o %}

#ifndef BUILD_TEST
#include <stdio.h>

__global__ void simple_kernel(float *d_array) {
Expand Down Expand Up @@ -81,4 +82,4 @@ int main(int argc, char **argv) {
cudaFree(d_array);
return 0;
}

#endif
Loading

0 comments on commit 06886c8

Please sign in to comment.