summaryrefslogtreecommitdiffstats
path: root/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/0001-Revert-Change-builtin-kernels-compilation-process.patch
diff options
context:
space:
mode:
Diffstat (limited to 'dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/0001-Revert-Change-builtin-kernels-compilation-process.patch')
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/0001-Revert-Change-builtin-kernels-compilation-process.patch117
1 files changed, 117 insertions, 0 deletions
diff --git a/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/0001-Revert-Change-builtin-kernels-compilation-process.patch b/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/0001-Revert-Change-builtin-kernels-compilation-process.patch
new file mode 100644
index 00000000..ec3d3183
--- /dev/null
+++ b/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/0001-Revert-Change-builtin-kernels-compilation-process.patch
@@ -0,0 +1,117 @@
1From f031f4d7ab4021c2b60391b3a957e75fac14c2e3 Mon Sep 17 00:00:00 2001
2From: Dongwon Kim <dongwon.kim@intel.com>
3Date: Sat, 21 Aug 2021 11:27:59 -0700
4Subject: [PATCH] Revert "Change builtin kernels compilation process"
5
6This reverts commit ab52c702337358af57140e760d618549372e1cdd.
7Upstream-Status: Pending
8Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
9---
10 .../offline_compiler_tests.cpp | 23 ----------------
11 .../source/offline_compiler.cpp | 2 +-
12 .../source/built_ins/kernels/CMakeLists.txt | 26 +++++++------------
13 3 files changed, 10 insertions(+), 41 deletions(-)
14
15diff --git a/opencl/test/unit_test/offline_compiler/offline_compiler_tests.cpp b/opencl/test/unit_test/offline_compiler/offline_compiler_tests.cpp
16index 1427cd5cc..8b913d740 100644
17--- a/opencl/test/unit_test/offline_compiler/offline_compiler_tests.cpp
18+++ b/opencl/test/unit_test/offline_compiler/offline_compiler_tests.cpp
19@@ -1651,27 +1651,4 @@ TEST(OclocCompile, givenPackedDeviceBinaryFormatWhenGeneratingElfBinaryThenItIsR
20 ASSERT_EQ(true, ocloc.generateElfBinary());
21 EXPECT_EQ(0, memcmp(zebin.storage.data(), ocloc.elfBinary.data(), zebin.storage.size()));
22 }
23-
24-TEST(OclocCompile, givenSpirvInputThenDontGenerateSpirvFile) {
25- MockOfflineCompiler ocloc;
26-
27- std::vector<std::string> argv = {
28- "ocloc",
29- "-q",
30- "-file",
31- "test_files/binary_with_zeroes",
32- "-out_dir",
33- "offline_compiler_test",
34- "-device",
35- gEnvironment->devicePrefix.c_str(),
36- "-spirv_input"};
37-
38- int retVal = ocloc.initialize(argv.size(), argv);
39- ASSERT_EQ(0, retVal);
40- retVal = ocloc.build();
41- EXPECT_EQ(0, retVal);
42- EXPECT_TRUE(compilerOutputExists("offline_compiler_test/binary_with_zeroes", "gen"));
43- EXPECT_TRUE(compilerOutputExists("offline_compiler_test/binary_with_zeroes", "bin"));
44- EXPECT_FALSE(compilerOutputExists("offline_compiler_test/binary_with_zeroes", "spv"));
45-}
46 } // namespace NEO
47diff --git a/shared/offline_compiler/source/offline_compiler.cpp b/shared/offline_compiler/source/offline_compiler.cpp
48index 0ffc3bbca..aa02e0550 100644
49--- a/shared/offline_compiler/source/offline_compiler.cpp
50+++ b/shared/offline_compiler/source/offline_compiler.cpp
51@@ -1050,7 +1050,7 @@ void OfflineCompiler::writeOutAllFiles() {
52 }
53 }
54
55- if (irBinary && !inputFileSpirV) {
56+ if (irBinary) {
57 std::string irOutputFileName = generateFilePathForIr(fileBase) + generateOptsSuffix();
58
59 argHelper->saveOutput(irOutputFileName, irBinary, irBinarySize);
60diff --git a/shared/source/built_ins/kernels/CMakeLists.txt b/shared/source/built_ins/kernels/CMakeLists.txt
61index 59723fdb2..12dc4aa7a 100644
62--- a/shared/source/built_ins/kernels/CMakeLists.txt
63+++ b/shared/source/built_ins/kernels/CMakeLists.txt
64@@ -58,8 +58,11 @@ function(compile_builtin gen_type platform_type builtin bits builtin_options mod
65 # get name of the file w/o extension
66 get_filename_component(BASENAME ${builtin} NAME_WE)
67
68- set(OUTPUT_FILE_SPV
69- ${OUTPUTDIR}/${mode}_${BASENAME}_${family_name_with_type}.spv
70+ set(OUTPUTPATH_BASE "${OUTPUTDIR}/${mode}_${BASENAME}_${family_name_with_type}")
71+ set(OUTPUT_FILES
72+ ${OUTPUTPATH_BASE}.spv
73+ ${OUTPUTPATH_BASE}.bin
74+ ${OUTPUTPATH_BASE}.gen
75 )
76
77 if(NOT DEFINED cloc_cmd_prefix)
78@@ -76,8 +79,8 @@ function(compile_builtin gen_type platform_type builtin bits builtin_options mod
79 list(APPEND __cloc__options__ "-cl-kernel-arg-info")
80 set(INTERNAL_OPTIONS "${${mode}_OPTIONS}")
81 add_custom_command(
82- OUTPUT ${OUTPUT_FILE_SPV}
83- COMMAND ${cloc_cmd_prefix} -q -file ${FILENAME} -spv_only -device ${DEFAULT_SUPPORTED_${gen_type}_${platform_type}_PLATFORM} ${builtin_options} -${bits} -output ${mode}_${BASENAME} -out_dir ${OUTPUTDIR} ${INTERNAL_OPTIONS} -options "$<JOIN:${__cloc__options__}, >"
84+ OUTPUT ${OUTPUT_FILES}
85+ COMMAND ${cloc_cmd_prefix} -q -file ${FILENAME} -device ${DEFAULT_SUPPORTED_${gen_type}_${platform_type}_PLATFORM} ${builtin_options} -${bits} -output ${mode}_${BASENAME} -out_dir ${OUTPUTDIR} ${INTERNAL_OPTIONS} -options "$<JOIN:${__cloc__options__}, >"
86 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
87 DEPENDS ${builtin} ocloc copy_compiler_files
88 )
89@@ -85,23 +88,12 @@ function(compile_builtin gen_type platform_type builtin bits builtin_options mod
90 set(OUTPUT_FILE_CPP
91 ${OUTPUTDIR}/${mode}_${BASENAME}_${family_name_with_type}_${REVISION_ID}.cpp
92 )
93- set(BINARY_OUTPUT "${OUTPUTDIR}/${mode}_${BASENAME}_${REVISION_ID}_${family_name_with_type}")
94- set(OUTPUT_FILES_BINARIES
95- ${BINARY_OUTPUT}.gen
96- ${BINARY_OUTPUT}.bin
97- )
98 list(APPEND BUILTINS_COMMANDS "${OUTPUT_FILE_CPP}")
99- add_custom_command(
100- OUTPUT ${OUTPUT_FILES_BINARIES}
101- COMMAND ${cloc_cmd_prefix} -q -file ${OUTPUT_FILE_SPV} -spirv_input -device ${DEFAULT_SUPPORTED_${gen_type}_${platform_type}_PLATFORM} ${builtin_options} -${bits} -output ${mode}_${BASENAME}_${REVISION_ID} -out_dir ${OUTPUTDIR} -revision_id ${REVISION_ID} ${INTERNAL_OPTIONS} -options "$<JOIN:${__cloc__options__}, >"
102- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
103- DEPENDS ${OUTPUT_FILE_SPV} ocloc copy_compiler_files
104- )
105 add_custom_command(
106 OUTPUT ${OUTPUT_FILE_CPP}
107- COMMAND $<TARGET_FILE:cpp_generate_tool> --file ${BINARY_OUTPUT}.gen --output ${OUTPUT_FILE_CPP} --array ${mode}_${BASENAME} --platform ${family_name_with_type} --revision_id ${REVISION_ID}
108+ COMMAND $<TARGET_FILE:cpp_generate_tool> --file ${OUTPUTPATH_BASE}.gen --output ${OUTPUT_FILE_CPP} --array ${mode}_${BASENAME} --platform ${family_name_with_type} --revision_id ${REVISION_ID}
109 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
110- DEPENDS ${OUTPUT_FILES_BINARIES} $<TARGET_FILE:cpp_generate_tool>
111+ DEPENDS ${OUTPUTPATH_BASE}.gen $<TARGET_FILE:cpp_generate_tool>
112 )
113 endforeach()
114 set(BUILTINS_COMMANDS ${BUILTINS_COMMANDS} PARENT_SCOPE)
115--
1162.20.1
117