From: Anuj Mittal <[email protected]>

Use the option to use Khronos translator instead of the
pre-built SPIRVDLL with VC. Also have the native recipe
install a binary needed for the target builds.

Signed-off-by: Anuj Mittal <[email protected]>
Signed-off-by: Naveen Saini <[email protected]>
---
 ...akeLists.txt-remove-opt-from-DEPENDS.patch | 35 +++++++++++++++++++
 .../igc/intel-graphics-compiler_1.0.8744.bb   |  7 +++-
 2 files changed, 41 insertions(+), 1 deletion(-)
 create mode 100644 
dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-BiF-CMakeLists.txt-remove-opt-from-DEPENDS.patch

diff --git 
a/dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-BiF-CMakeLists.txt-remove-opt-from-DEPENDS.patch
 
b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-BiF-CMakeLists.txt-remove-opt-from-DEPENDS.patch
new file mode 100644
index 00000000..a6af0ef3
--- /dev/null
+++ 
b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-BiF-CMakeLists.txt-remove-opt-from-DEPENDS.patch
@@ -0,0 +1,35 @@
+From 6f6997066040c5f33bf05ffde36a9800dcde1fcf Mon Sep 17 00:00:00 2001
+From: Anuj Mittal <[email protected]>
+Date: Tue, 12 Oct 2021 23:46:42 +0800
+Subject: [PATCH] BiF/CMakeLists.txt: remove opt from DEPENDS
+
+Otherwise it starts failing with:
+
+| ninja: error: 'IGC/VectorCompiler/lib/BiF/opt', needed by 
'IGC/VectorCompiler/lib/BiF/VCBiFPrintfOCL32.opt.bc', missing and no known rule 
to make it
+
+We don't need to explicitly make sure opt is built when
+using prebuilt binaries.
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Anuj Mittal <[email protected]>
+---
+ IGC/VectorCompiler/lib/BiF/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/IGC/VectorCompiler/lib/BiF/CMakeLists.txt 
b/IGC/VectorCompiler/lib/BiF/CMakeLists.txt
+index 5d9a901d7..66e59e399 100644
+--- a/IGC/VectorCompiler/lib/BiF/CMakeLists.txt
++++ b/IGC/VectorCompiler/lib/BiF/CMakeLists.txt
+@@ -88,7 +88,7 @@ function(vc_embed_bif RES_FILE CMCL_SRC_PATH BIF_NAME 
PTR_BIT_SIZE)
+   add_custom_command(OUTPUT ${BIF_OPT_BC_PATH}
+     COMMAND ${LLVM_OPT_EXE} --O2 -o ${BIF_OPT_BC_NAME} ${BIF_CMCL_BC_NAME}
+     COMMENT "vc_embed_bif: running opt with O2: ${BIF_CMCL_BC_NAME} -> 
${BIF_OPT_BC_NAME}"
+-    DEPENDS opt ${BIF_CMCL_BC_PATH})
++    DEPENDS ${BIF_CMCL_BC_PATH})
+   add_custom_command(
+     OUTPUT ${BIF_CPP_PATH}
+     COMMAND ${PYTHON_EXECUTABLE} ${RESOURCE_EMBEDDER_SCRIPT} 
${BIF_OPT_BC_NAME} ${BIF_CPP_NAME}
+-- 
+2.32.0
+
diff --git 
a/dynamic-layers/clang-layer/recipes-opencl/igc/intel-graphics-compiler_1.0.8744.bb
 
b/dynamic-layers/clang-layer/recipes-opencl/igc/intel-graphics-compiler_1.0.8744.bb
index 1469bc14..9ed828bc 100644
--- 
a/dynamic-layers/clang-layer/recipes-opencl/igc/intel-graphics-compiler_1.0.8744.bb
+++ 
b/dynamic-layers/clang-layer/recipes-opencl/igc/intel-graphics-compiler_1.0.8744.bb
@@ -13,6 +13,7 @@ SRC_URI = 
"git://github.com/intel/intel-graphics-compiler.git;protocol=https;nam
            
file://0001-llvm_deps.cmake-don-t-copy-header-file-when-building.patch \
            file://0003-Improve-Reproducibility-for-src-package.patch \
            file://0004-find-external-llvm-tblgen.patch \
+           file://0001-BiF-CMakeLists.txt-remove-opt-from-DEPENDS.patch \
            "
 
 SRCREV_igc = "3ba8dde8c414a0e47df58b1bba12a64f8ba2089e"
@@ -40,12 +41,16 @@ EXTRA_OECMAKE = " \
                   -DPYTHON_EXECUTABLE=${HOSTTOOLS_DIR}/python3 \
                   -DVC_INTRINSICS_SRC="${S}/vc-intrinsics" \
                   -DIGC_OPTION__LLVM_MODE=Prebuilds \
-                  -DIGC_BUILD__VC_ENABLED=OFF \
+                  -DIGC_BUILD__VC_ENABLED=ON \
+                  -DIGC_OPTION__LINK_KHRONOS_SPIRV_TRANSLATOR=ON \
+                  -DIGC_OPTION__USE_KHRONOS_SPIRV_TRANSLATOR_IN_VC=ON \
+                  -DIGC_OPTION__SPIRV_TRANSLATOR_MODE=Prebuilds \
                   "
 
 do_install:append:class-native () {
     install -d ${D}${bindir}
     install ${B}/IGC/Release/elf_packager ${D}${bindir}/
+    install ${B}/IGC/Release/CMCLTranslatorTool ${D}${bindir}/
 }
 
 BBCLASSEXTEND = "native nativesdk"
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#7310): 
https://lists.yoctoproject.org/g/meta-intel/message/7310
Mute This Topic: https://lists.yoctoproject.org/mt/86508246/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-intel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to