freebsd-ports/devel/ispc/files/patch-src_ispc.cpp
Jan Beich eb3ceff682 devel/ispc: enable Intel GPU support
https://ispc.github.io/ispc_for_gen.html

PR:		257720
Tested by:	yuri (testsuite has about the same set of failures as before)
Submitted by:	jbeich
2021-09-09 08:52:04 -07:00

25 lines
997 B
C++

--- src/ispc.cpp.orig 2021-07-15 23:04:31 UTC
+++ src/ispc.cpp
@@ -1464,10 +1464,22 @@ std::string Target::GetTripleString() const {
triple.setArchName("armv7");
} else if (m_arch == Arch::aarch64) {
triple.setArchName("aarch64");
+ } else if (m_arch == Arch::genx32) {
+ triple.setArchName("spir");
+ } else if (m_arch == Arch::genx64) {
+ triple.setArchName("spir64");
} else {
Error(SourcePos(), "Unknown arch.");
exit(1);
}
+#ifdef ISPC_GENX_ENABLED
+ if (m_arch == Arch::genx32 || m_arch == Arch::genx64) {
+ //"spir64-unknown-unknown"
+ triple.setVendor(llvm::Triple::VendorType::UnknownVendor);
+ triple.setOS(llvm::Triple::OSType::UnknownOS);
+ return triple.str();
+ }
+#endif
triple.setVendor(llvm::Triple::VendorType::UnknownVendor);
triple.setOS(llvm::Triple::OSType::FreeBSD);
break;