diff --git a/clang/test/dpct/pytorch/ATen.cu b/clang/test/dpct/pytorch/ATen.cu new file mode 100644 index 000000000000..df7e065b8067 --- /dev/null +++ b/clang/test/dpct/pytorch/ATen.cu @@ -0,0 +1,23 @@ +// RUN: rm -rf %T/pytorch/ATen +// RUN: mkdir -p %T/pytorch/ATen/src +// RUN: cp %S/ATen.cu %T/pytorch/ATen/src/ +// RUN: cp %S/user_defined_rule_pytorch.yaml %T/pytorch/ATen/ +// RUN: cp -r %S/pytorch_cuda_inc %T/pytorch/ATen/ +// RUN: cd %T/pytorch/ATen +// RUN: mkdir dpct_out +// RUN: dpct -out-root dpct_out src/ATen.cu --extra-arg="-I./pytorch_cuda_inc" --cuda-include-path="%cuda-path/include" --rule-file=user_defined_rule_pytorch.yaml -- -x cuda --cuda-host-only +// RUN: FileCheck --input-file dpct_out/ATen.dp.cpp --match-full-lines src/ATen.cu +// RUN: %if build_lit %{icpx -c -fsycl -DNO_BUILD_TEST dpct_out/ATen.dp.cpp -o dpct_out/ATen.dp.o %} + +#ifndef NO_BUILD_TEST +#include +// CHECK: #include +#include +// CHECK: #include +#include + +int main() { + + return 0; +} +#endif diff --git a/clang/test/dpct/pytorch_c10_cuda_ns.cu b/clang/test/dpct/pytorch/c10.cu similarity index 53% rename from clang/test/dpct/pytorch_c10_cuda_ns.cu rename to clang/test/dpct/pytorch/c10.cu index 4a4a7a8bf5f7..64ed41a9996b 100644 --- a/clang/test/dpct/pytorch_c10_cuda_ns.cu +++ b/clang/test/dpct/pytorch/c10.cu @@ -1,14 +1,13 @@ -// RUN: rm -rf %T/src -// RUN: mkdir %T/src -// RUN: cp %S/pytorch_c10_cuda_ns.cu %T/src/ -// RUN: cp %S/user_defined_rule_pytorch.yaml %T/ -// RUN: cp -r %S/pytorch_cuda_inc %T/ -// RUN: cd %T -// RUN: rm -rf %T/pytorch_c10_cuda_ns_output -// RUN: mkdir %T/pytorch_c10_cuda_ns_output -// RUN: dpct -out-root %T/pytorch_c10_cuda_ns_output src/pytorch_c10_cuda_ns.cu --extra-arg="-I./pytorch_cuda_inc" --cuda-include-path="%cuda-path/include" --rule-file=user_defined_rule_pytorch.yaml -- -x cuda --cuda-host-only -// RUN: FileCheck --input-file %T/pytorch_c10_cuda_ns_output/pytorch_c10_cuda_ns.dp.cpp --match-full-lines %T/src/pytorch_c10_cuda_ns.cu -// RUN: %if build_lit %{icpx -c -fsycl -DNO_BUILD_TEST %T/pytorch_c10_cuda_ns_output/pytorch_c10_cuda_ns.dp.cpp -o %T/pytorch_c10_cuda_ns_output/pytorch_c10_cuda_ns.dp.o %} +// RUN: rm -rf %T/pytorch/c10 +// RUN: mkdir -p %T/pytorch/c10/src +// RUN: cp %S/c10.cu %T/pytorch/c10/src/ +// RUN: cp %S/user_defined_rule_pytorch.yaml %T/pytorch/c10/ +// RUN: cp -r %S/pytorch_cuda_inc %T/pytorch/c10/ +// RUN: cd %T/pytorch/c10 +// RUN: mkdir dpct_out +// RUN: dpct -out-root dpct_out src/c10.cu --extra-arg="-I./pytorch_cuda_inc" --cuda-include-path="%cuda-path/include" --rule-file=user_defined_rule_pytorch.yaml -- -x cuda --cuda-host-only +// RUN: FileCheck --input-file dpct_out/c10.dp.cpp --match-full-lines src/c10.cu +// RUN: %if build_lit %{icpx -c -fsycl -DNO_BUILD_TEST dpct_out/c10.dp.cpp -o dpct_out/c10.dp.o %} #ifndef NO_BUILD_TEST #include diff --git a/clang/test/dpct/pytorch_cuda_inc/ATen/core/Tensor.h b/clang/test/dpct/pytorch/pytorch_cuda_inc/ATen/core/Tensor.h similarity index 100% rename from clang/test/dpct/pytorch_cuda_inc/ATen/core/Tensor.h rename to clang/test/dpct/pytorch/pytorch_cuda_inc/ATen/core/Tensor.h diff --git a/clang/test/dpct/pytorch_cuda_inc/ATen/cuda/CUDAContext.h b/clang/test/dpct/pytorch/pytorch_cuda_inc/ATen/cuda/CUDAContext.h similarity index 100% rename from clang/test/dpct/pytorch_cuda_inc/ATen/cuda/CUDAContext.h rename to clang/test/dpct/pytorch/pytorch_cuda_inc/ATen/cuda/CUDAContext.h diff --git a/clang/test/dpct/pytorch_cuda_inc/c10/cuda/CUDAGuard.h b/clang/test/dpct/pytorch/pytorch_cuda_inc/c10/cuda/CUDAGuard.h similarity index 100% rename from clang/test/dpct/pytorch_cuda_inc/c10/cuda/CUDAGuard.h rename to clang/test/dpct/pytorch/pytorch_cuda_inc/c10/cuda/CUDAGuard.h diff --git a/clang/test/dpct/pytorch_cuda_inc/c10/cuda/CUDAStream.h b/clang/test/dpct/pytorch/pytorch_cuda_inc/c10/cuda/CUDAStream.h similarity index 100% rename from clang/test/dpct/pytorch_cuda_inc/c10/cuda/CUDAStream.h rename to clang/test/dpct/pytorch/pytorch_cuda_inc/c10/cuda/CUDAStream.h diff --git a/clang/test/dpct/user_defined_rule_pytorch.yaml b/clang/test/dpct/pytorch/user_defined_rule_pytorch.yaml similarity index 100% rename from clang/test/dpct/user_defined_rule_pytorch.yaml rename to clang/test/dpct/pytorch/user_defined_rule_pytorch.yaml diff --git a/clang/test/dpct/pytorch_ATen_cuda_ns.cu b/clang/test/dpct/pytorch_ATen_cuda_ns.cu deleted file mode 100644 index 54e5daf5c05e..000000000000 --- a/clang/test/dpct/pytorch_ATen_cuda_ns.cu +++ /dev/null @@ -1,24 +0,0 @@ -// RUN: rm -rf %T/pytorch_ATen_cuda_ns -// RUN: mkdir %T/pytorch_ATen_cuda_ns -// RUN: cp %S/pytorch_ATen_cuda_ns.cu %T/pytorch_ATen_cuda_ns/ -// RUN: cp %S/user_defined_rule_pytorch.yaml %T/ -// RUN: cp -r %S/pytorch_cuda_inc %T/ -// RUN: cd %T -// RUN: rm -rf %T/pytorch_ATen_cuda_ns_output -// RUN: mkdir %T/pytorch_ATen_cuda_ns_output -// RUN: dpct -out-root %T/pytorch_ATen_cuda_ns_output %T/pytorch_ATen_cuda_ns/pytorch_ATen_cuda_ns.cu --extra-arg="-I./pytorch_cuda_inc" --cuda-include-path="%cuda-path/include" --rule-file=%T/user_defined_rule_pytorch.yaml -- -x cuda --cuda-host-only -// RUN: FileCheck --input-file %T/pytorch_ATen_cuda_ns_output/pytorch_ATen_cuda_ns.dp.cpp --match-full-lines %T/pytorch_ATen_cuda_ns/pytorch_ATen_cuda_ns.cu -// RUN: %if build_lit %{icpx -c -fsycl -DNO_BUILD_TEST %T/pytorch_ATen_cuda_ns_output/pytorch_ATen_cuda_ns.dp.cpp -o %T/pytorch_ATen_cuda_ns_output/pytorch_ATen_cuda_ns.dp.o %} - -#ifndef NO_BUILD_TEST -#include -// CHECK: #include -#include -// CHECK: #include -#include - -int main() { - - return 0; -} -#endif