Skip to content

Commit 1539807

Browse files
Revert "Remove SPV_KHR_bfloat16 workaround"
Signed-off-by: Whitney Tsang <[email protected]>
1 parent 64d37e7 commit 1539807

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

third_party/intel/cmake/FindSPIRVToLLVMTranslator.cmake

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,30 @@ if (NOT SPIRVToLLVMTranslator_FOUND)
2626

2727
FetchContent_MakeAvailable(spirv-llvm-translator)
2828

29+
# FIXME: Don't apply patch when Agama driver is updated.
30+
execute_process(
31+
COMMAND git apply --check ${CMAKE_CURRENT_LIST_DIR}/3122.patch
32+
WORKING_DIRECTORY ${spirv-llvm-translator_SOURCE_DIR}
33+
ERROR_QUIET
34+
RESULT_VARIABLE PATCH_RESULT
35+
)
36+
if(PATCH_RESULT EQUAL 0)
37+
execute_process(
38+
COMMAND git apply ${CMAKE_CURRENT_LIST_DIR}/3122.patch
39+
WORKING_DIRECTORY ${spirv-llvm-translator_SOURCE_DIR}
40+
RESULT_VARIABLE PATCH_RESULT
41+
)
42+
else()
43+
execute_process( # Check if the patch is already applied
44+
COMMAND git apply --reverse --check ${CMAKE_CURRENT_LIST_DIR}/3122.patch
45+
WORKING_DIRECTORY ${spirv-llvm-translator_SOURCE_DIR}
46+
RESULT_VARIABLE PATCH_RESULT
47+
)
48+
endif()
49+
if(NOT PATCH_RESULT EQUAL 0)
50+
message(FATAL_ERROR "Failed to apply 3122.patch to SPIRV-LLVM-Translator")
51+
endif()
52+
2953
# FIXME: Don't apply patch when Agama driver is updated to incorporate with the SPV_INTEL_bfloat16_arithmetic extension.
3054
execute_process(
3155
COMMAND git apply --check ${CMAKE_CURRENT_LIST_DIR}/3388.patch

0 commit comments

Comments
 (0)