FreeBSD Bugzilla – Attachment 227060 Details for
Bug 257720
devel/ispc: enable Intel GPU support
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
v1 (apply via "git am")
bug257720.diff (text/plain), 5.25 KB, created by
Jan Beich
on 2021-08-09 20:56:33 UTC
(
hide
)
Description:
v1 (apply via "git am")
Filename:
MIME Type:
Creator:
Jan Beich
Created:
2021-08-09 20:56:33 UTC
Size:
5.25 KB
patch
obsolete
>From 2483d8c892969fa16ae1283cd50b867d3fa7efb0 Mon Sep 17 00:00:00 2001 >From: Jan Beich <jbeich@FreeBSD.org> >Date: Mon, 9 Aug 2021 20:28:28 +0000 >Subject: [PATCH] devel/ispc: enable Intel GPU support > >https://ispc.github.io/ispc_for_gen.html > >PR: 257720 >Tested by: ? >Approved by: yuri (maintainer) >--- > devel/ispc/Makefile | 24 ++++++++++++++++++ > .../files/patch-cmake_GenerateBuiltins.cmake | 11 ++++++++ > devel/ispc/files/patch-src_ispc.cpp | 25 +++++++++++++++++++ > devel/ispc/files/patch-src_module.cpp | 20 +++++++++++++++ > 4 files changed, 80 insertions(+) > create mode 100644 devel/ispc/files/patch-cmake_GenerateBuiltins.cmake > create mode 100644 devel/ispc/files/patch-src_ispc.cpp > create mode 100644 devel/ispc/files/patch-src_module.cpp > >diff --git a/devel/ispc/Makefile b/devel/ispc/Makefile >index 00b0b716254b..8bcfa95a296a 100644 >--- a/devel/ispc/Makefile >+++ b/devel/ispc/Makefile >@@ -3,6 +3,7 @@ > PORTNAME= ispc > DISTVERSIONPREFIX= v > DISTVERSION= 1.16.1 >+PORTREVISION= 1 > CATEGORIES= devel > > MAINTAINER= yuri@FreeBSD.org >@@ -35,6 +36,29 @@ BINARY_ALIAS= flex=${LOCALBASE}/bin/flex python=${PYTHON_CMD} m4=${LOCALBASE}/bi > PLIST_FILES= bin/ispc \ > bin/check_isa > >+OPTIONS_DEFINE_amd64= GENX >+OPTIONS_DEFAULT_amd64= GENX >+ >+GENX_DESC= Intel GPU 8/16-wide SIMD support >+GENX_BUILD_DEPENDS= ${LOCALBASE}/llvm${LLVM_VERSION}/lib/libLLVMGenXIntrinsics.a:devel/vc-intrinsics@llvm${LLVM_VERSION} >+GENX_LIB_DEPENDS= libze_loader.so:devel/level-zero \ >+ libLLVMSPIRVLib.so.${LLVM_VERSION}:devel/spirv-llvm-translator@llvm${LLVM_VERSION} >+GENX_CMAKE_BOOL= GENX_ENABLED >+GENX_CMAKE_BOOL_OFF= ISPCRT_BUILD_TESTS >+GENX_CMAKE_ON= -DGENX_DEPS_DIR:PATH="${LOCALBASE}/llvm${LLVM_VERSION}" >+GENX_PLIST_FILES= include/ispcrt/ispcrt.h \ >+ include/ispcrt/ispcrt.hpp \ >+ include/ispcrt/ispcrt.isph \ >+ lib/cmake/ispcrt-${PORTVERSION}/Findlevel_zero.cmake \ >+ lib/cmake/ispcrt-${PORTVERSION}/ispc.cmake \ >+ lib/cmake/ispcrt-${PORTVERSION}/ispcrtConfig.cmake \ >+ lib/cmake/ispcrt-${PORTVERSION}/ispcrt_Exports-%%CMAKE_BUILD_TYPE%%.cmake \ >+ lib/cmake/ispcrt-${PORTVERSION}/ispcrt_Exports.cmake \ >+ lib/libispcrt.so \ >+ lib/libispcrt.so.1 \ >+ lib/libispcrt.so.${PORTVERSION} \ >+ lib/libispcrt_static.a >+ > do-test: # some tests fail: https://github.com/ispc/ispc/issues/1868 > @cd ${WRKSRC} && ISPC_HOME=${BUILD_WRKSRC}/bin ./run_tests.py > >diff --git a/devel/ispc/files/patch-cmake_GenerateBuiltins.cmake b/devel/ispc/files/patch-cmake_GenerateBuiltins.cmake >new file mode 100644 >index 000000000000..e541332c18f1 >--- /dev/null >+++ b/devel/ispc/files/patch-cmake_GenerateBuiltins.cmake >@@ -0,0 +1,11 @@ >+--- cmake/GenerateBuiltins.cmake.orig 2021-07-15 23:04:31 UTC >++++ cmake/GenerateBuiltins.cmake >+@@ -289,6 +289,8 @@ function(builtin_genx_to_cpp bit resultFileName) >+ set(os_name "windows") >+ elseif (APPLE) >+ set(SKIP ON) >++ elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") >++ set(os_name "freebsd") >+ else () >+ set(os_name "linux") >+ endif() >diff --git a/devel/ispc/files/patch-src_ispc.cpp b/devel/ispc/files/patch-src_ispc.cpp >new file mode 100644 >index 000000000000..e06e096d9b80 >--- /dev/null >+++ b/devel/ispc/files/patch-src_ispc.cpp >@@ -0,0 +1,25 @@ >+--- 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; >diff --git a/devel/ispc/files/patch-src_module.cpp b/devel/ispc/files/patch-src_module.cpp >new file mode 100644 >index 000000000000..987c2fcb2fd6 >--- /dev/null >+++ b/devel/ispc/files/patch-src_module.cpp >@@ -0,0 +1,20 @@ >+--- src/module.cpp.orig 2021-07-15 23:04:31 UTC >++++ src/module.cpp >+@@ -102,7 +102,7 @@ >+ #define OCLOC_LIBRARY_NAME "ocloc64.dll" >+ #elif defined(_WIN32) >+ #define OCLOC_LIBRARY_NAME "ocloc32.dll" >+-#elif defined(__linux__) >++#elif defined(__linux__) || defined(__FreeBSD__) >+ #define OCLOC_LIBRARY_NAME "libocloc.so" >+ #else >+ #error "Unexpected platform" >+@@ -1149,7 +1149,7 @@ bool Module::translateToSPIRV(llvm::Module *module, st >+ llvm::cl::desc("Allow DWARF operations not listed in the OpenCL.DebugInfo.100 " >+ "specification (experimental, may produce incompatible SPIR-V " >+ "module)")); >+-#if ISPC_LLVM_VERSION < ISPC_LLVM_12_0 >++#if ISPC_LLVM_VERSION >= ISPC_LLVM_13_0 >+ Opts.setSPIRVAllowUnknownIntrinsics({"llvm.genx"}); >+ #else >+ llvm::cl::opt<bool> SPIRVAllowUnknownIntrinsics(
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 257720
: 227060