Skip to content

Commit

Permalink
[SYCLomaitc][PyTorch][Bug] Fix user_defined_rule_pytorch.yaml rule co…
Browse files Browse the repository at this point in the history
…py bug (#2535)
  • Loading branch information
TejaX-Alaghari authored Dec 6, 2024
1 parent 186d502 commit efee38d
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 35 deletions.
23 changes: 23 additions & 0 deletions clang/test/dpct/pytorch/ATen.cu
Original file line number Diff line number Diff line change
@@ -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 <iostream>
// CHECK: #include <ATen/xpu/XPUContext.h>
#include <ATen/cuda/CUDAContext.h>
// CHECK: #include <ATen/core/Tensor.h>
#include <ATen/core/Tensor.h>

int main() {

return 0;
}
#endif
Original file line number Diff line number Diff line change
@@ -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 <iostream>
Expand Down
24 changes: 0 additions & 24 deletions clang/test/dpct/pytorch_ATen_cuda_ns.cu

This file was deleted.

0 comments on commit efee38d

Please sign in to comment.