From owner-dev-commits-ports-all@freebsd.org Thu Sep 9 15:53:11 2021 Return-Path: Delivered-To: dev-commits-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 07463672917; Thu, 9 Sep 2021 15:53:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H53SQ68xgz3NCq; Thu, 9 Sep 2021 15:53:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9A951C686; Thu, 9 Sep 2021 15:53:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 189FrAKX050659; Thu, 9 Sep 2021 15:53:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 189FrALl050658; Thu, 9 Sep 2021 15:53:10 GMT (envelope-from git) Date: Thu, 9 Sep 2021 15:53:10 GMT Message-Id: <202109091553.189FrALl050658@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Yuri Victorovich Subject: git: eb3ceff68268 - main - devel/ispc: enable Intel GPU support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuri X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eb3ceff682682389456e66657eabd66e01fdbca4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 15:53:11 -0000 The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=eb3ceff682682389456e66657eabd66e01fdbca4 commit eb3ceff682682389456e66657eabd66e01fdbca4 Author: Jan Beich AuthorDate: 2021-08-09 20:28:28 +0000 Commit: Yuri Victorovich CommitDate: 2021-09-09 15:52:04 +0000 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 --- devel/ispc/Makefile | 24 +++++++++++++++++++++ .../ispc/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(+) 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 SPIRVAllowUnknownIntrinsics(