Skip to content

Commit

Permalink
Corrected format and refiend test logic
Browse files Browse the repository at this point in the history
  • Loading branch information
TejaX-Alaghari committed Jan 7, 2025
1 parent 628cd85 commit e8a1fca
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 69 deletions.
2 changes: 1 addition & 1 deletion clang/lib/DPCT/MigrateScript/MigrateBuildScript.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ void unifyInputFileFormat(
} // namespace dpct
} // namespace clang

#endif //!DPCT_MIGRATE_BUILD_SCRIPT_H
#endif //! DPCT_MIGRATE_BUILD_SCRIPT_H
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"directory": "./",
"file": "./input.cu"
}
]
]
48 changes: 24 additions & 24 deletions clang/test/dpct/python_migration/case_001/case_001_framework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,49 @@
// RUN: cp %S/src/compile_commands.json ./compile_commands.json

// RUN: dpct -in-root ./ -out-root out_pytorch_1 --migrate-build-script-only --migrate-build-script=Python --rule-file=%T/../../../../../../../extensions/python_rules/python_build_script_migration_rule_pytorch.yaml
// RUN: echo "begin" > %T/diff_python_pytorch_1.txt
// RUN: diff --strip-trailing-cr %S/expected_pytorch.py %T/out_pytorch_1/input.py >> %T/diff_python_pytorch_1.txt
// RUN: echo "end" >> %T/diff_python_pytorch_1.txt
// RUN: echo "begin" > %T/diff.txt
// RUN: diff --strip-trailing-cr %S/expected_pytorch.py %T/out_pytorch_1/input.py >> %T/diff.txt
// RUN: echo "end" >> %T/diff.txt
// CHECK: begin
// CHECK-NEXT: end

// RUN: dpct -in-root ./ -out-root out_pytorch_2 --migrate-build-script-only --migrate-build-script=CMake,Python --rule-file=%T/../../../../../../../extensions/python_rules/python_build_script_migration_rule_pytorch.yaml
// RUN: echo "begin" > %T/diff_python_pytorch.txt
// RUN: diff --strip-trailing-cr %S/expected_pytorch.py %T/out_pytorch_2/input.py >> %T/diff_python_pytorch.txt
// RUN: echo "end" >> %T/diff_python_pytorch.txt
// RUN: echo "begin" > %T/diff.txt
// RUN: diff --strip-trailing-cr %S/expected_pytorch.py %T/out_pytorch_2/input.py >> %T/diff.txt
// RUN: echo "end" >> %T/diff.txt
// CHECK: begin
// CHECK-NEXT: end
// RUN: echo "begin" > %T/diff_cmake_pytorch.txt
// RUN: diff --strip-trailing-cr %S/expected.cmake %T/out_pytorch_2/input.cmake >> %T/diff_cmake_pytorch.txt
// RUN: echo "end" >> %T/diff_cmake_pytorch.txt
// RUN: echo "begin" > %T/diff.txt
// RUN: diff --strip-trailing-cr %S/expected.cmake %T/out_pytorch_2/input.cmake >> %T/diff.txt
// RUN: echo "end" >> %T/diff.txt
// CHECK: begin
// CHECK-NEXT: end

// RUN: dpct -in-root ./ -out-root out_ipex_1 --cuda-include-path="%cuda-path/include" --migrate-build-script=Python --rule-file=%T/../../../../../../../extensions/python_rules/python_build_script_migration_rule_ipex.yaml -p ./
// RUN: echo "begin" > %T/diff_python_ipex.txt
// RUN: diff --strip-trailing-cr %S/expected_ipex.py %T/out_ipex_1/input.py >> %T/diff_python_ipex.txt
// RUN: echo "end" >> %T/diff_python_ipex.txt
// RUN: echo "begin" > %T/diff.txt
// RUN: diff --strip-trailing-cr %S/expected_ipex.py %T/out_ipex_1/input.py >> %T/diff.txt
// RUN: echo "end" >> %T/diff.txt
// CHECK: begin
// CHECK-NEXT: end
// RUN: echo "begin" > %T/diff_src_ipex.txt
// RUN: diff --strip-trailing-cr %S/src/expected.cpp.txt %T/out_ipex_1/input.dp.cpp >> %T/diff_src_ipex.txt
// RUN: echo "end" >> %T/diff_src_ipex.txt
// RUN: echo "begin" > %T/diff.txt
// RUN: diff --strip-trailing-cr %S/src/expected.cpp.txt %T/out_ipex_1/input.dp.cpp >> %T/diff.txt
// RUN: echo "end" >> %T/diff.txt
// CHECK: begin
// CHECK-NEXT: end

// RUN: dpct -in-root ./ -out-root out_ipex_2 --cuda-include-path="%cuda-path/include" --migrate-build-script=CMake,Python --rule-file=%T/../../../../../../../extensions/python_rules/python_build_script_migration_rule_ipex.yaml -p ./
// RUN: echo "begin" > %T/diff_python_ipex.txt
// RUN: diff --strip-trailing-cr %S/expected_ipex.py %T/out_ipex_2/input.py >> %T/diff_python_ipex.txt
// RUN: echo "end" >> %T/diff_python_ipex.txt
// RUN: echo "begin" > %T/diff.txt
// RUN: diff --strip-trailing-cr %S/expected_ipex.py %T/out_ipex_2/input.py >> %T/diff.txt
// RUN: echo "end" >> %T/diff.txt
// CHECK: begin
// CHECK-NEXT: end
// RUN: echo "begin" > %T/diff_cmake_ipex.txt
// RUN: diff --strip-trailing-cr %S/expected.cmake %T/out_ipex_2/input.cmake >> %T/diff_cmake_ipex.txt
// RUN: echo "end" >> %T/diff_cmake_ipex.txt
// RUN: echo "begin" > %T/diff.txt
// RUN: diff --strip-trailing-cr %S/expected.cmake %T/out_ipex_2/input.cmake >> %T/diff.txt
// RUN: echo "end" >> %T/diff.txt
// CHECK: begin
// CHECK-NEXT: end
// RUN: echo "begin" > %T/diff_src_ipex.txt
// RUN: diff --strip-trailing-cr %S/src/expected.cpp.txt %T/out_ipex_2/input.dp.cpp >> %T/diff_src_ipex.txt
// RUN: echo "end" >> %T/diff_src_ipex.txt
// RUN: echo "begin" > %T/diff.txt
// RUN: diff --strip-trailing-cr %S/src/expected.cpp.txt %T/out_ipex_2/input.dp.cpp >> %T/diff.txt
// RUN: echo "end" >> %T/diff.txt
// CHECK: begin
// CHECK-NEXT: end
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
// RUN: cp %S/input.py ./input.py

// RUN: dpct -in-root ./ -out-root out_pytorch ./input.py --migrate-build-script-only --migrate-build-script=Python --rule-file=%T/../../../../../../../extensions/python_rules/python_build_script_migration_rule_pytorch.yaml
// RUN: echo "begin" > %T/diff_pytorch.txt
// RUN: diff --strip-trailing-cr %S/expected_pytorch.py %T/out_pytorch/input.py >> %T/diff_pytorch.txt
// RUN: echo "end" >> %T/diff_pytorch.txt
// RUN: echo "begin" > %T/diff.txt
// RUN: diff --strip-trailing-cr %S/expected_pytorch.py %T/out_pytorch/input.py >> %T/diff.txt
// RUN: echo "end" >> %T/diff.txt
// CHECK: begin
// CHECK-NEXT: end

// RUN: dpct -in-root ./ -out-root out_ipex ./input.py --migrate-build-script-only --migrate-build-script=Python --rule-file=%T/../../../../../../../extensions/python_rules/python_build_script_migration_rule_ipex.yaml
// RUN: echo "begin" > %T/diff_ipex.txt
// RUN: diff --strip-trailing-cr %S/expected_ipex.py %T/out_ipex/input.py >> %T/diff_ipex.txt
// RUN: echo "end" >> %T/diff_ipex.txt
// RUN: echo "begin" > %T/diff.txt
// RUN: diff --strip-trailing-cr %S/expected_ipex.py %T/out_ipex/input.py >> %T/diff.txt
// RUN: echo "end" >> %T/diff.txt
// CHECK: begin
// CHECK-NEXT: end
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
// RUN: cp %S/input.py ./input.py

// RUN: dpct -in-root ./ -out-root out_pytorch ./input.py --migrate-build-script-only --migrate-build-script=Python --rule-file=%T/../../../../../../../extensions/python_rules/python_build_script_migration_rule_pytorch.yaml
// RUN: echo "begin" > %T/diff_pytorch.txt
// RUN: diff --strip-trailing-cr %S/expected_pytorch.py %T/out_pytorch/input.py >> %T/diff_pytorch.txt
// RUN: echo "end" >> %T/diff_pytorch.txt
// RUN: echo "begin" > %T/diff.txt
// RUN: diff --strip-trailing-cr %S/expected_pytorch.py %T/out_pytorch/input.py >> %T/diff.txt
// RUN: echo "end" >> %T/diff.txt
// CHECK: begin
// CHECK-NEXT: end

// RUN: dpct -in-root ./ -out-root out_ipex ./input.py --migrate-build-script-only --migrate-build-script=Python --rule-file=%T/../../../../../../../extensions/python_rules/python_build_script_migration_rule_ipex.yaml
// RUN: echo "begin" > %T/diff_ipex.txt
// RUN: diff --strip-trailing-cr %S/expected_ipex.py %T/out_ipex/input.py >> %T/diff_ipex.txt
// RUN: echo "end" >> %T/diff_ipex.txt
// RUN: echo "begin" > %T/diff.txt
// RUN: diff --strip-trailing-cr %S/expected_ipex.py %T/out_ipex/input.py >> %T/diff.txt
// RUN: echo "end" >> %T/diff.txt
// CHECK: begin
// CHECK-NEXT: end
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
// RUN: cp %S/input.py ./input.py

// RUN: dpct -in-root ./ -out-root out_pytorch ./input.py --migrate-build-script-only --migrate-build-script=Python --rule-file=%T/../../../../../../../extensions/python_rules/python_build_script_migration_rule_pytorch.yaml
// RUN: echo "begin" > %T/diff_pytorch.txt
// RUN: diff --strip-trailing-cr %S/expected.py %T/out_pytorch/input.py >> %T/diff_pytorch.txt
// RUN: echo "end" >> %T/diff_pytorch.txt
// RUN: echo "begin" > %T/diff.txt
// RUN: diff --strip-trailing-cr %S/expected.py %T/out_pytorch/input.py >> %T/diff.txt
// RUN: echo "end" >> %T/diff.txt
// CHECK: begin
// CHECK-NEXT: end

// RUN: dpct -in-root ./ -out-root out_ipex ./input.py --migrate-build-script-only --migrate-build-script=Python --rule-file=%T/../../../../../../../extensions/python_rules/python_build_script_migration_rule_ipex.yaml
// RUN: echo "begin" > %T/diff_ipex.txt
// RUN: diff --strip-trailing-cr %S/expected.py %T/out_ipex/input.py >> %T/diff_ipex.txt
// RUN: echo "end" >> %T/diff_ipex.txt
// RUN: echo "begin" > %T/diff.txt
// RUN: diff --strip-trailing-cr %S/expected.py %T/out_ipex/input.py >> %T/diff.txt
// RUN: echo "end" >> %T/diff.txt
// CHECK: begin
// CHECK-NEXT: end
10 changes: 5 additions & 5 deletions clang/test/dpct/python_migration/case_005/case_005_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
// RUN: cp %S/input.py ./input.py

// RUN: dpct -in-root ./ -out-root out_pytorch ./input.py --migrate-build-script-only --migrate-build-script=Python --rule-file=%T/../../../../../../../extensions/python_rules/python_build_script_migration_rule_pytorch.yaml
// RUN: echo "begin" > %T/diff_pytorch.txt
// RUN: diff --strip-trailing-cr %S/expected_pytorch.py %T/out_pytorch/input.py >> %T/diff_pytorch.txt
// RUN: echo "end" >> %T/diff_pytorch.txt
// RUN: echo "begin" > %T/diff.txt
// RUN: diff --strip-trailing-cr %S/expected_pytorch.py %T/out_pytorch/input.py >> %T/diff.txt
// RUN: echo "end" >> %T/diff.txt
// CHECK: begin
// CHECK-NEXT: end

// RUN: dpct -in-root ./ -out-root out_ipex ./input.py --migrate-build-script-only --migrate-build-script=Python --rule-file=%T/../../../../../../../extensions/python_rules/python_build_script_migration_rule_ipex.yaml
// RUN: echo "begin" > %T/diff.txt
// RUN: diff --strip-trailing-cr %S/expected_ipex.py %T/out_ipex/input.py >> %T/diff_ipex.txt
// RUN: echo "end" >> %T/diff_ipex.txt
// RUN: diff --strip-trailing-cr %S/expected_ipex.py %T/out_ipex/input.py >> %T/diff.txt
// RUN: echo "end" >> %T/diff.txt
// CHECK: begin
// CHECK-NEXT: end
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
// RUN: cp %S/input.py ./input.py

// RUN: dpct -in-root ./ -out-root out_pytorch ./input.py --migrate-build-script-only --migrate-build-script=Python --rule-file=%T/../../../../../../../extensions/python_rules/python_build_script_migration_rule_pytorch.yaml
// RUN: echo "begin" > %T/diff_pytorch.txt
// RUN: diff --strip-trailing-cr %S/expected.py %T/out_pytorch/input.py >> %T/diff_pytorch.txt
// RUN: echo "end" >> %T/diff_pytorch.txt
// RUN: echo "begin" > %T/diff.txt
// RUN: diff --strip-trailing-cr %S/expected.py %T/out_pytorch/input.py >> %T/diff.txt
// RUN: echo "end" >> %T/diff.txt
// CHECK: begin
// CHECK-NEXT: end

// RUN: dpct -in-root ./ -out-root out_ipex ./input.py --migrate-build-script-only --migrate-build-script=Python --rule-file=%T/../../../../../../../extensions/python_rules/python_build_script_migration_rule_ipex.yaml
// RUN: echo "begin" > %T/diff.txt
// RUN: diff --strip-trailing-cr %S/expected.py %T/out_ipex/input.py >> %T/diff_ipex.txt
// RUN: echo "end" >> %T/diff_ipex.txt
// RUN: diff --strip-trailing-cr %S/expected.py %T/out_ipex/input.py >> %T/diff.txt
// RUN: echo "end" >> %T/diff.txt
// CHECK: begin
// CHECK-NEXT: end
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
// RUN: cp %S/MainSourceFiles.yaml ./out_ipex/MainSourceFiles.yaml

// RUN: dpct -in-root ./ -out-root out_pytorch ./input.py --migrate-build-script-only --migrate-build-script=Python --rule-file=%T/../../../../../../../extensions/python_rules/python_build_script_migration_rule_pytorch.yaml
// RUN: echo "begin" > %T/diff_pytorch.txt
// RUN: diff --strip-trailing-cr %S/expected.py %T/out_pytorch/input.py >> %T/diff_pytorch.txt
// RUN: echo "end" >> %T/diff_pytorch.txt
// RUN: echo "begin" > %T/diff.txt
// RUN: diff --strip-trailing-cr %S/expected.py %T/out_pytorch/input.py >> %T/diff.txt
// RUN: echo "end" >> %T/diff.txt
// CHECK: begin
// CHECK-NEXT: end

// RUN: dpct -in-root ./ -out-root out_ipex ./input.py --migrate-build-script-only --migrate-build-script=Python --rule-file=%T/../../../../../../../extensions/python_rules/python_build_script_migration_rule_ipex.yaml
// RUN: echo "begin" > %T/diff.txt
// RUN: diff --strip-trailing-cr %S/expected.py %T/out_ipex/input.py >> %T/diff_ipex.txt
// RUN: echo "end" >> %T/diff_ipex.txt
// RUN: diff --strip-trailing-cr %S/expected.py %T/out_ipex/input.py >> %T/diff.txt
// RUN: echo "end" >> %T/diff.txt
// CHECK: begin
// CHECK-NEXT: end
10 changes: 5 additions & 5 deletions clang/test/dpct/python_migration/case_008/case_008_comments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
// RUN: cp %S/input.py ./input.py

// RUN: dpct -in-root ./ -out-root out_pytorch ./input.py --migrate-build-script-only --migrate-build-script=Python --rule-file=%T/../../../../../../../extensions/python_rules/python_build_script_migration_rule_pytorch.yaml
// RUN: echo "begin" > %T/diff_pytorch.txt
// RUN: diff --strip-trailing-cr %S/expected_pytorch.py %T/out_pytorch/input.py >> %T/diff_pytorch.txt
// RUN: echo "end" >> %T/diff_pytorch.txt
// RUN: echo "begin" > %T/diff.txt
// RUN: diff --strip-trailing-cr %S/expected_pytorch.py %T/out_pytorch/input.py >> %T/diff.txt
// RUN: echo "end" >> %T/diff.txt
// CHECK: begin
// CHECK-NEXT: end

// RUN: dpct -in-root ./ -out-root out_ipex ./input.py --migrate-build-script-only --migrate-build-script=Python --rule-file=%T/../../../../../../../extensions/python_rules/python_build_script_migration_rule_ipex.yaml
// RUN: echo "begin" > %T/diff.txt
// RUN: diff --strip-trailing-cr %S/expected_ipex.py %T/out_ipex/input.py >> %T/diff_ipex.txt
// RUN: echo "end" >> %T/diff_ipex.txt
// RUN: diff --strip-trailing-cr %S/expected_ipex.py %T/out_ipex/input.py >> %T/diff.txt
// RUN: echo "end" >> %T/diff.txt
// CHECK: begin
// CHECK-NEXT: end
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
// RUN: cp %S/input.py ./input.py

// RUN: dpct -in-root ./ -out-root out_pytorch ./input.py --migrate-build-script-only --migrate-build-script=Python --rule-file=%T/../../../../../../../extensions/python_rules/python_build_script_migration_rule_pytorch.yaml
// RUN: echo "begin" > %T/diff_pytorch.txt
// RUN: diff --strip-trailing-cr %S/expected_pytorch.py %T/out_pytorch/input.py >> %T/diff_pytorch.txt
// RUN: echo "end" >> %T/diff_pytorch.txt
// RUN: echo "begin" > %T/diff.txt
// RUN: diff --strip-trailing-cr %S/expected_pytorch.py %T/out_pytorch/input.py >> %T/diff.txt
// RUN: echo "end" >> %T/diff.txt
// CHECK: begin
// CHECK-NEXT: end

// RUN: dpct -in-root ./ -out-root out_ipex ./input.py --migrate-build-script-only --migrate-build-script=Python --rule-file=%T/../../../../../../../extensions/python_rules/python_build_script_migration_rule_ipex.yaml
// RUN: echo "begin" > %T/diff.txt
// RUN: diff --strip-trailing-cr %S/expected_ipex.py %T/out_ipex/input.py >> %T/diff_ipex.txt
// RUN: echo "end" >> %T/diff_ipex.txt
// RUN: diff --strip-trailing-cr %S/expected_ipex.py %T/out_ipex/input.py >> %T/diff.txt
// RUN: echo "end" >> %T/diff.txt
// CHECK: begin
// CHECK-NEXT: end

0 comments on commit e8a1fca

Please sign in to comment.