Skip to content

Commit 1c260fb

Browse files
WIP
1 parent fea14d7 commit 1c260fb

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

third_party/intel/backend/compiler.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,10 @@ def make_llir(cls, src, metadata, options):
409409
@classmethod
410410
@track
411411
def make_spv(cls, src, metadata, options):
412+
driver_version = metadata["target"].arch.get("driver_version")
413+
if driver_version != "1.13.35563+7":
414+
print(f"Warning: Detected driver version {driver_version}. ")
415+
os.environ["INTEL_XPU_BACKEND_DRIVER_VERSION"] = driver_version
412416
spirv, name = intel.translate_to_spirv(src)
413417
metadata["name"] = name
414418
metadata.setdefault("build_flags", "")

third_party/intel/cmake/3122.patch

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/lib/SPIRV/SPIRVWriter.cpp b/lib/SPIRV/SPIRVWriter.cpp
2-
index ec4ec41f..9cad08d8 100644
2+
index ec4ec41f..dc49b871 100644
33
--- a/lib/SPIRV/SPIRVWriter.cpp
44
+++ b/lib/SPIRV/SPIRVWriter.cpp
5-
@@ -401,13 +401,15 @@ SPIRVType *LLVMToSPIRVBase::transType(Type *T) {
5+
@@ -401,13 +401,16 @@ SPIRVType *LLVMToSPIRVBase::transType(Type *T) {
66
}
77

88
if (T->isBFloatTy()) {
@@ -13,7 +13,8 @@ index ec4ec41f..9cad08d8 100644
1313
- "NOTE: LLVM module contains bfloat type, translation of which "
1414
- "requires this extension");
1515
- return mapType(T, BM->addFloatType(16, FPEncodingBFloat16KHR));
16-
+ if (BM->isAllowedToUseExtension(ExtensionID::SPV_KHR_bfloat16)) {
16+
+ const char *driverVersion = std::getenv("INTEL_XPU_BACKEND_DRIVER_VERSION");
17+
+ if (driverVersion && std::string(driverVersion) == "1.13.35563+7") {
1718
+ BM->getErrorLog().checkError(
1819
+ BM->isAllowedToUseExtension(ExtensionID::SPV_KHR_bfloat16),
1920
+ SPIRVEC_RequiresExtension,

0 commit comments

Comments
 (0)