diff options
author | kwm <kwm@FreeBSD.org> | 2015-09-18 02:07:25 +0800 |
---|---|---|
committer | kwm <kwm@FreeBSD.org> | 2015-09-18 02:07:25 +0800 |
commit | de6c33481611d149822bfb915757f0845f01d819 (patch) | |
tree | a430ad3dbd823ddb88d16ecc11a7a7035985cf79 /lang | |
parent | 668ef943969eb0ed94107ed0918f1ed3b789a4c2 (diff) | |
download | freebsd-ports-gnome-de6c33481611d149822bfb915757f0845f01d819.tar.gz freebsd-ports-gnome-de6c33481611d149822bfb915757f0845f01d819.tar.zst freebsd-ports-gnome-de6c33481611d149822bfb915757f0845f01d819.zip |
Update Mesa port to 10.6.6 and add Clover.
Add beignet 1.1.0.
Add clinfo, clblas, clfft and clrng.
The major change is that all Mesa ports are now configured the same way.
This fixes several problems and enables new features. The details
are described in this blog post:
http://blogs.freebsdish.org/graphics/2015/03/18/unifying-mesa-ports-configure/
The second important change is the OpenCL support. Mesa's
implementation, Clover, is enabled as well as Beignet. Clover
targets all Gallium drivers, only Radeon GPUs in our case. Beignet
is for Intel GPUs starting with Ivy Bridge. Thanks to Johannes
Dieterich, O. Hartman, and Koop Mast for their work on OpenCL! As a
bonus, there are several OpenCL-based math ports added (clblas,
clfft and clrng). For more information and known issues, please see
https://wiki.freebsd.org/Graphics/OpenCL
The third change is the removal of Mesa 9.1.7 which was installed on
FreeBSD 9.3-RELEASE. There is now only one version of Mesa in the Ports
tree (10.6.6) for all supported versions of FreeBSD.
Other, smaller changes:
* Include libosmesa into the Mesa framework; this changes libOSMesa
shlib version.
* bsd.mesalib.mk was renamed and split up in two files namely
Makefile.common and Makefile.targets. So ports can overwrite variables
set by Makefile.common and are used by Makefile.targets.
* Some text in the pkg-descr files was wrong, clean it up. While here,
update the WWW to the main mesa3d.org upstream page.
* devel/clinfo was added, a glxinfo like program but for OpenCL.
Non-x86 hardware reports are very welcome since we changed the framework
quite a bit.
Obtained from: Graphics team development repo.
Diffstat (limited to 'lang')
25 files changed, 538 insertions, 0 deletions
diff --git a/lang/Makefile b/lang/Makefile index 34ff81698646..a42c4878a5d7 100644 --- a/lang/Makefile +++ b/lang/Makefile @@ -19,6 +19,7 @@ SUBDIR += awka SUBDIR += bas2tap SUBDIR += basic256 + SUBDIR += beignet SUBDIR += bf2c SUBDIR += bigloo SUBDIR += bsh @@ -42,6 +43,7 @@ SUBDIR += clojure SUBDIR += clojure-mode.el SUBDIR += cloudabi-clang + SUBDIR += clover SUBDIR += cmucl SUBDIR += cmucl-extra SUBDIR += cocor diff --git a/lang/beignet/Makefile b/lang/beignet/Makefile new file mode 100644 index 000000000000..2aeea643fcef --- /dev/null +++ b/lang/beignet/Makefile @@ -0,0 +1,55 @@ +# Created by: Koop Mast <kwm@FreeBSD.org> +# $FreeBSD$ + +PORTNAME= beignet +PORTVERSION= 1.1.0 +CATEGORIES= lang +MASTER_SITES= https://01.org/sites/default/files/ +DISTVERSIONSUFFIX= -source + +MAINTAINER= kwm@FreeBSD.org +COMMENT= OpenCL library for Intel GPUs + +BUILD_DEPENDS= clang${LLVMVER}:${PORTSDIR}/lang/clang${LLVMVER} \ + opencl>=0:${PORTSDIR}/devel/opencl +LIB_DEPENDS= libOpenCL.so:${PORTSDIR}/devel/ocl-icd \ + libdrm.so:${PORTSDIR}/graphics/libdrm +RUN_DEPENDS= opencl>=0:${PORTSDIR}/devel/opencl + +WRKSRC= ${WRKDIR}/Beignet-${PORTVERSION}-Source + +USES= cmake gmake pkgconfig shebangfix +USE_XORG= sm ice x11 xext xfixes +USE_GL= gl +SHEBANG_FILES= src/git_sha1.sh backend/kernels/compile.sh +LLVMVER= 36 + +CMAKE_ARGS+= -DLLVM_CONFIG_EXECUTABLE=${LOCALBASE}/bin/llvm-config${LLVMVER} + +ONLY_FOR_ARCHS= i386 amd64 +ONLY_FOR_ARCHS_REASON= Beignet needs a graphics driver supported by the Intel KMS driver + +BROKEN_FreeBSD_10= Does not build. Help appreciated +BROKEN_FreeBSD_9= Beignet is only supported on FreeBSD 10.1 and newer + +# running tests from makefile doesn't work quite yet, so comment them out for now. +#OPTIONS_DEFINE= TESTS +#TESTS_DESC= Build and run the test suite + +.include <bsd.port.options.mk> + +post-patch: + @${REINPLACE_CMD} -e 's|llvm-dis|llvm-dis${LLVMVER}|g; \ + s|clang |clang${LLVMVER} |g' \ + ${WRKSRC}/backend/kernels/compile.sh +#post-patch-TESTS-off: + @${REINPLACE_CMD} -e 's|ADD_SUBDIRECTORY(utests)||g' \ + ${WRKSRC}/CMakeLists.txt + +post-install: + @${RM} -rf ${STAGEDIR}${PREFIX}/include/CL + +#post-install-TESTS-on: +# @cd ${WRKSRC}/utests && sh ./setenv.sh && ./utest_run + +.include <bsd.port.mk> diff --git a/lang/beignet/distinfo b/lang/beignet/distinfo new file mode 100644 index 000000000000..f59603851413 --- /dev/null +++ b/lang/beignet/distinfo @@ -0,0 +1,2 @@ +SHA256 (beignet-1.1.0-source.tar.gz) = 4afe09ea13cd7f8475b9f6534e97cb4dcd307c602095c6968b0ed22290753386 +SIZE (beignet-1.1.0-source.tar.gz) = 938923 diff --git a/lang/beignet/files/patch-CMakeLists.txt b/lang/beignet/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..5550d65726a1 --- /dev/null +++ b/lang/beignet/files/patch-CMakeLists.txt @@ -0,0 +1,20 @@ +--- CMakeLists.txt.orig 2015-03-16 05:39:34.000000000 +0100 ++++ CMakeLists.txt 2015-03-27 20:29:34.695731000 +0100 +@@ -101,7 +101,7 @@ + ENDIF (USE_STANDALONE_GBE_COMPILER STREQUAL "true") + + +-set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-Bsymbolic -Wl,--no-undefined ${LLVM_LDFLAGS}") ++set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-Bsymbolic ${LLVM_LDFLAGS}") + + # XLib + Find_Package(X11) +@@ -190,7 +190,7 @@ + "intel-beignet.icd.in" + "${ICD_FILE_NAME}" + ) +- install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${ICD_FILE_NAME} DESTINATION /etc/OpenCL/vendors) ++ install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${ICD_FILE_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/etc/OpenCL/vendors) + ELSE(OCLIcd_FOUND) + MESSAGE(STATUS "Looking for OCL ICD header file - not found") + ENDIF(OCLIcd_FOUND) diff --git a/lang/beignet/files/patch-CMake_FindLLVM.cmake b/lang/beignet/files/patch-CMake_FindLLVM.cmake new file mode 100644 index 000000000000..0d2b308743e1 --- /dev/null +++ b/lang/beignet/files/patch-CMake_FindLLVM.cmake @@ -0,0 +1,30 @@ +--- CMake/FindLLVM.cmake.orig 2015-04-17 03:59:38.000000000 +0200 ++++ CMake/FindLLVM.cmake 2015-05-09 00:27:01.012701000 +0200 +@@ -52,21 +52,21 @@ + + if (LLVM_INSTALL_DIR) + find_program(CLANG_EXECUTABLE +- NAMES clang-${LLVM_VERSION_NODOT} clang-${LLVM_VERSION_NOPATCH} clang ++ NAMES clang${LLVM_VERSION_NODOT} clang-${LLVM_VERSION_NODOT} clang-${LLVM_VERSION_NOPATCH} clang + PATHS ${LLVM_INSTALL_DIR} NO_DEFAULT_PATH) + find_program(LLVM_AS_EXECUTABLE +- NAMES llvm-as-${LLVM_VERSION_NODOT} llvm-as-${LLVM_VERSION_NOPATCH} llvm-as ++ NAMES llvm-as${LLVM_VERSION_NODOT} llvm-as-${LLVM_VERSION_NODOT} llvm-as-${LLVM_VERSION_NOPATCH} llvm-as + PATHS ${LLVM_INSTALL_DIR} NO_DEFAULT_PATH) + find_program(LLVM_LINK_EXECUTABLE +- NAMES llvm-link-${LLVM_VERSION_NODOT} llvm-link-${LLVM_VERSION_NOPATCH} llvm-link ++ NAMES llvm-link${LLVM_VERSION_NODOT} llvm-link-${LLVM_VERSION_NODOT} llvm-link-${LLVM_VERSION_NOPATCH} llvm-link + PATHS ${LLVM_INSTALL_DIR} NO_DEFAULT_PATH) + else (LLVM_INSTALL_DIR) + find_program(CLANG_EXECUTABLE +- NAMES clang-${LLVM_VERSION_NODOT} clang-${LLVM_VERSION_NOPATCH} clang) ++ NAMES clang${LLVM_VERSION_NODOT} clang-${LLVM_VERSION_NODOT} clang-${LLVM_VERSION_NOPATCH} clang) + find_program(LLVM_AS_EXECUTABLE +- NAMES llvm-as-${LLVM_VERSION_NODOT} llvm-as-${LLVM_VERSION_NOPATCH} llvm-as) ++ NAMES llvm-as${LLVM_VERSION_NODOT} llvm-as-${LLVM_VERSION_NODOT} llvm-as-${LLVM_VERSION_NOPATCH} llvm-as) + find_program(LLVM_LINK_EXECUTABLE +- NAMES llvm-link-${LLVM_VERSION_NODOT} llvm-link-${LLVM_VERSION_NOPATCH} llvm-link) ++ NAMES llvm-link${LLVM_VERSION_NODOT} llvm-link-${LLVM_VERSION_NODOT} llvm-link-${LLVM_VERSION_NOPATCH} llvm-link) + endif (LLVM_INSTALL_DIR) + + execute_process( diff --git a/lang/beignet/files/patch-backend_src_backend_gen-insn-selection.cpp b/lang/beignet/files/patch-backend_src_backend_gen-insn-selection.cpp new file mode 100644 index 000000000000..29c6bc30467e --- /dev/null +++ b/lang/beignet/files/patch-backend_src_backend_gen-insn-selection.cpp @@ -0,0 +1,15 @@ +--- backend/src/backend/gen_insn_selection.cpp.orig 2015-08-26 11:57:48.961363000 +0200 ++++ backend/src/backend/gen_insn_selection.cpp 2015-08-26 11:58:15.326657000 +0200 +@@ -1752,11 +1752,11 @@ namespace gbe + + // Boiler plate to initialize the selection library at c++ pre-main + static SelectionLibrary *selLib = NULL; ++ __attribute__((destructor)) + static void destroySelectionLibrary(void) { GBE_DELETE(selLib); } + static struct SelectionLibraryInitializer { + SelectionLibraryInitializer(void) { + selLib = GBE_NEW_NO_ARG(SelectionLibrary); +- atexit(destroySelectionLibrary); + } + } selectionLibraryInitializer; + diff --git a/lang/beignet/files/patch-backend_src_backend_gen__reg__allocation.cpp b/lang/beignet/files/patch-backend_src_backend_gen__reg__allocation.cpp new file mode 100644 index 000000000000..622fdf4a4c2c --- /dev/null +++ b/lang/beignet/files/patch-backend_src_backend_gen__reg__allocation.cpp @@ -0,0 +1,10 @@ +--- backend/src/backend/gen_reg_allocation.cpp.orig 2015-01-30 00:57:16.930955286 +0100 ++++ backend/src/backend/gen_reg_allocation.cpp 2015-01-30 00:57:53.886912927 +0100 +@@ -33,6 +33,7 @@ + #include <climits> + #include <iostream> + #include <iomanip> ++#include <sys/types.h> + + + namespace gbe diff --git a/lang/beignet/files/patch-backend_src_ir_immediate.hpp b/lang/beignet/files/patch-backend_src_ir_immediate.hpp new file mode 100644 index 000000000000..645d7f91a2f7 --- /dev/null +++ b/lang/beignet/files/patch-backend_src_ir_immediate.hpp @@ -0,0 +1,10 @@ +--- backend/src/ir/immediate.hpp.orig 2015-01-30 01:06:19.873878476 +0100 ++++ backend/src/ir/immediate.hpp 2015-01-30 01:06:29.286877660 +0100 +@@ -25,6 +25,7 @@ + #ifndef __GBE_IR_IMMEDIATE_HPP__ + #define __GBE_IR_IMMEDIATE_HPP__ + ++#include <cmath> + #include <string.h> + #include "ir/type.hpp" + #include "sys/platform.hpp" diff --git a/lang/beignet/files/patch-backend_src_sys_alloc.cpp b/lang/beignet/files/patch-backend_src_sys_alloc.cpp new file mode 100644 index 000000000000..48a29278be3c --- /dev/null +++ b/lang/beignet/files/patch-backend_src_sys_alloc.cpp @@ -0,0 +1,68 @@ +--- backend/src/sys/alloc.cpp.orig 2015-07-02 09:39:05.000000000 +0200 ++++ backend/src/sys/alloc.cpp 2015-08-26 11:57:00.901815000 +0200 +@@ -69,7 +69,7 @@ namespace gbe + /*! Total number of allocations done */ + volatile intptr_t allocNum; + /*! Sorts the file name and function name strings */ +- std::tr1::unordered_map<const char*, int> staticStringMap; ++ std::unordered_map<const char*, int> staticStringMap; + /*! Each element contains the actual string */ + std::vector<const char*> staticStringVector; + std::map<uintptr_t, AllocData> allocMap; +@@ -140,16 +140,17 @@ namespace gbe + static bool isMutexInitializing = true; + static size_t memDebuggerCurrSize(0u); + static size_t memDebuggerMaxSize(0u); ++ __attribute__((destructor)) + static void SizeMutexDeallocate(void) { if (sizeMutex) delete sizeMutex; } + static void SizeMutexAllocate(void) { + if (sizeMutex == NULL && isMutexInitializing == false) { + isMutexInitializing = true; + sizeMutex = new MutexSys; +- atexit(SizeMutexDeallocate); + } + } + + /*! Stop the memory debugger */ ++ __attribute__((destructor)) + static void MemDebuggerEnd(void) { + MemDebugger *_debug = memDebugger; + memDebugger = NULL; +@@ -172,7 +173,6 @@ namespace gbe + /*! Start the memory debugger */ + static void MemDebuggerStart(void) { + if (memDebugger == NULL) { +- atexit(MemDebuggerEnd); + memDebugger = new MemDebugger; + } + } +@@ -291,6 +291,29 @@ namespace gbe + void alignedFree(void *ptr) { if (ptr) std::free(ptr); } + } /* namespace gbe */ + ++#elif defined(__FreeBSD__) ++ ++#include <unistd.h> ++#include <sys/mman.h> ++#include <fcntl.h> ++#include <stdlib.h> ++#include <malloc_np.h> ++#include <iostream> ++ ++namespace gbe ++{ ++ void* alignedMalloc(size_t size, size_t align) { ++ void* ptr; ++ const int err = posix_memalign(&ptr,align,size); ++ FATAL_IF ((err != 0), "memory allocation failed"); ++ MemDebuggerInitializeMem(ptr, size); ++ return ptr; ++ } ++ ++ void alignedFree(void *ptr) { if (ptr) std::free(ptr); } ++} /* namespace gbe */ ++ ++ + #else + #error "Unsupported platform" + #endif /* __LINUX__ */ diff --git a/lang/beignet/files/patch-src_cl__alloc.c b/lang/beignet/files/patch-src_cl__alloc.c new file mode 100644 index 000000000000..e7c571f8e12f --- /dev/null +++ b/lang/beignet/files/patch-src_cl__alloc.c @@ -0,0 +1,25 @@ +--- src/cl_alloc.c.orig 2015-01-16 11:24:13.000000000 +0100 ++++ src/cl_alloc.c 2015-02-03 15:31:13.983452000 +0100 +@@ -22,7 +22,7 @@ + + #include <stdlib.h> + #include <assert.h> +-#include <malloc.h> ++#include <sys/types.h> + + static volatile int32_t cl_alloc_n = 0; + +@@ -41,8 +41,13 @@ + { + void * p = NULL; + atomic_inc(&cl_alloc_n); ++#ifndef __FreeBSD__ + p = memalign(align, sz); + assert(p); ++#else ++ const int err = posix_memalign(&p,align,sz); ++ assert(err==0); ++#endif + return p; + } + diff --git a/lang/beignet/files/patch-src_cl__api.c b/lang/beignet/files/patch-src_cl__api.c new file mode 100644 index 000000000000..7a416d00e726 --- /dev/null +++ b/lang/beignet/files/patch-src_cl__api.c @@ -0,0 +1,11 @@ +--- src/cl_api.c.orig 2015-02-03 14:58:29.071589000 +0100 ++++ src/cl_api.c 2015-02-03 14:58:39.124158000 +0100 +@@ -64,7 +64,7 @@ + return RET; \ + } while(0) + +-inline cl_int ++static inline cl_int + handle_events(cl_command_queue queue, cl_int num, const cl_event *wait_list, + cl_event* event, enqueue_data* data, cl_command_type type) + { diff --git a/lang/beignet/files/patch-src_cl__device__id.c b/lang/beignet/files/patch-src_cl__device__id.c new file mode 100644 index 000000000000..2b3729d1dd90 --- /dev/null +++ b/lang/beignet/files/patch-src_cl__device__id.c @@ -0,0 +1,67 @@ +diff --git a/src/cl_device_id.c b/src/cl_device_id.c +index e9e2c16..5f35248 100644 +--- src/cl_device_id.c ++++ src/cl_device_id.c +@@ -34,7 +34,12 @@ + #include <stdio.h> + #include <string.h> + #include <stdlib.h> ++#if defined(__linux__) + #include <sys/sysinfo.h> ++#elif defined(__FreeBSD__) ++#include <sys/types.h> ++#include <sys/sysctl.h> ++#endif + + #ifndef CL_VERSION_1_2 + #define CL_DEVICE_BUILT_IN_KERNELS 0x103F +@@ -202,6 +207,7 @@ LOCAL cl_device_id + cl_get_gt_device(void) + { + cl_device_id ret = NULL; ++/* FIXME check cl_driver_get_device_id() */ + const int device_id = cl_driver_get_device_id(); + cl_device_id device = NULL; + +@@ -526,7 +532,7 @@ skl_gt4_break: + case PCI_CHIP_SANDYBRIDGE_M_GT2_PLUS: + case PCI_CHIP_SANDYBRIDGE_BRIDGE_S: + case PCI_CHIP_SANDYBRIDGE_S_GT: +- // Intel(R) HD Graphics SandyBridge not supported yet ++ printf("Intel(R) HD Graphics SandyBridge not supported yet\n"); + ret = NULL; + break; + default: +@@ -546,6 +552,7 @@ skl_gt4_break: + /* Apply any driver-dependent updates to the device info */ + cl_driver_update_device_info(ret); + ++#if defined(__linux__) + struct sysinfo info; + if (sysinfo(&info) == 0) { + uint64_t two_gb = 2 * 1024 * 1024 * 1024ul; +@@ -554,6 +561,24 @@ skl_gt4_break: + two_gb : info.totalram; + ret->max_mem_alloc_size = ret->global_mem_size / 2; + } ++#elif defined(__FreeBSD__) || defined(__DragonFly__) ++ int mib[2]; ++ ++ mib[0] = CTL_HW; ++ mib[1] = HW_USERMEM; ++ ++ uint64_t totalram; ++ size_t len; ++ len = sizeof(totalram); ++ sysctl(mib, 2, &totalram, &len, NULL, 0); ++ ++ uint64_t two_gb = 2 * 1024 * 1024 * 1024ul; ++ ret->global_mem_size = (totalram > two_gb) ? ++ two_gb : totalram; ++ ret->max_mem_alloc_size = ret->global_mem_size / 2; ++#else ++#error "not implimentend on this OS" ++#endif + + return ret; + } diff --git a/lang/beignet/files/patch-src_cl__event.c b/lang/beignet/files/patch-src_cl__event.c new file mode 100644 index 000000000000..0122ce199d67 --- /dev/null +++ b/lang/beignet/files/patch-src_cl__event.c @@ -0,0 +1,11 @@ +--- src/cl_event.c.orig 2015-02-03 15:00:21.865295000 +0100 ++++ src/cl_event.c 2015-02-03 15:00:30.759495000 +0100 +@@ -28,7 +28,7 @@ + #include <assert.h> + #include <stdio.h> + +-inline cl_bool ++static inline cl_bool + cl_event_is_gpu_command_type(cl_command_type type) + { + switch(type) { diff --git a/lang/beignet/files/patch-src_cl__program.c b/lang/beignet/files/patch-src_cl__program.c new file mode 100644 index 000000000000..b4e4fde2d1dc --- /dev/null +++ b/lang/beignet/files/patch-src_cl__program.c @@ -0,0 +1,22 @@ +--- src/cl_program.c.orig 2015-02-03 14:59:12.541061000 +0100 ++++ src/cl_program.c 2015-02-03 15:00:05.989743000 +0100 +@@ -166,7 +166,8 @@ + return err; + } + +-inline cl_bool isBitcodeWrapper(const unsigned char *BufPtr, const unsigned char *BufEnd) ++static inline cl_bool ++isBitcodeWrapper(const unsigned char *BufPtr, const unsigned char *BufEnd) + { + // See if you can find the hidden message in the magic bytes :-). + // (Hint: it's a little-endian encoding.) +@@ -177,7 +178,8 @@ + BufPtr[3] == 0x0B; + } + +-inline cl_bool isRawBitcode(const unsigned char *BufPtr, const unsigned char *BufEnd) ++static inline cl_bool ++isRawBitcode(const unsigned char *BufPtr, const unsigned char *BufEnd) + { + // These bytes sort of have a hidden message, but it's not in + // little-endian this time, and it's a little redundant. diff --git a/lang/beignet/files/patch-src_git__sha1.sh b/lang/beignet/files/patch-src_git__sha1.sh new file mode 100644 index 000000000000..4e26b0e2071f --- /dev/null +++ b/lang/beignet/files/patch-src_git__sha1.sh @@ -0,0 +1,8 @@ +--- src/git_sha1.sh.orig 2015-01-16 10:24:13 UTC ++++ src/git_sha1.sh +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + + SOURCE_DIR=$1 + FILE=$2 diff --git a/lang/beignet/files/patch-src_performance.c b/lang/beignet/files/patch-src_performance.c new file mode 100644 index 000000000000..da37c13de418 --- /dev/null +++ b/lang/beignet/files/patch-src_performance.c @@ -0,0 +1,30 @@ +--- src/performance.c.orig 2015-08-26 11:58:45.989699000 +0200 ++++ src/performance.c 2015-08-26 11:59:40.117247000 +0200 +@@ -37,7 +37,6 @@ typedef struct storage + + + static storage record; +-static int atexit_registered = 0; + + + static context_storage_node * prev_context_pointer = NULL; +@@ -170,6 +169,7 @@ static int cmp(const void *a, const void + return 0; + } + ++__attribute__((destructor)) + static void print_time_info() + { + context_storage_node *p_context = record.context_storage; +@@ -273,11 +273,6 @@ static void print_time_info() + + static void insert(cl_context context, const char *kernel_name, const char *build_opt, float time) + { +- if(!atexit_registered) +- { +- atexit_registered = 1; +- atexit(print_time_info); +- } + context_storage_node *p_context = find_context(context); + kernel_storage_node *p_kernel = find_kernel(p_context, kernel_name, build_opt); + prev_context_pointer = p_context; diff --git a/lang/beignet/files/patch-utests_CMakeLists.txt b/lang/beignet/files/patch-utests_CMakeLists.txt new file mode 100644 index 000000000000..732c0d71e34f --- /dev/null +++ b/lang/beignet/files/patch-utests_CMakeLists.txt @@ -0,0 +1,17 @@ +--- utests/CMakeLists.txt.orig 2015-02-02 21:01:26.000000000 +0100 ++++ utests/CMakeLists.txt 2015-02-02 22:19:04.185677000 +0100 +@@ -230,12 +230,12 @@ + if(GEN_PCI_ID) + ADD_CUSTOM_COMMAND( + OUTPUT ${kernel_bin}.bin +- COMMAND ${GBE_BIN_GENERATER} ${kernel_bin}.cl -o${kernel_bin}.bin -t${GEN_PCI_ID} ++ COMMAND ${GBE_BIN_GENERATER} -o${kernel_bin}.bin -t${GEN_PCI_ID} ${kernel_bin}.cl + DEPENDS ${GBE_BIN_FILE} ${kernel_bin}.cl) + else(GEN_PCI_ID) + ADD_CUSTOM_COMMAND( + OUTPUT ${kernel_bin}.bin +- COMMAND ${GBE_BIN_GENERATER} ${kernel_bin}.cl -o${kernel_bin}.bin ++ COMMAND ${GBE_BIN_GENERATER} -o${kernel_bin}.bin ${kernel_bin}.cl + DEPENDS ${GBE_BIN_FILE} ${kernel_bin}.cl) + endif(GEN_PCI_ID) + diff --git a/lang/beignet/files/patch-utests_builtin__exp.cpp b/lang/beignet/files/patch-utests_builtin__exp.cpp new file mode 100644 index 000000000000..2caa96b6d24d --- /dev/null +++ b/lang/beignet/files/patch-utests_builtin__exp.cpp @@ -0,0 +1,14 @@ +--- utests/builtin_exp.cpp.orig 2015-01-16 10:24:13 UTC ++++ utests/builtin_exp.cpp +@@ -25,7 +25,11 @@ static void cpu_compiler_math(float *dst + + dst[0] = exp(x); + dst[1] = exp2(x); ++#ifndef __FreeBSD__ + dst[2] = exp10(x); ++#else ++ dst[2] = powf(10,x); ++#endif + dst[3] = expm1(x); + dst[4] = x; + } diff --git a/lang/beignet/files/patch-utests_utest.cpp b/lang/beignet/files/patch-utests_utest.cpp new file mode 100644 index 000000000000..c9596494376f --- /dev/null +++ b/lang/beignet/files/patch-utests_utest.cpp @@ -0,0 +1,18 @@ +--- utests/utest.cpp.orig 2015-08-26 12:00:07.664830000 +0200 ++++ utests/utest.cpp 2015-08-26 12:00:37.039946000 +0200 +@@ -44,6 +44,7 @@ + RStatistics UTest::retStatistics; + + void releaseUTestList(void) { delete UTest::utestList; } ++__attribute__((destructor)) + void runSummaryAtExit(void) { + // If case crashes, count it as fail, and accumulate finishrun + if(UTest::retStatistics.finishrun != UTest::utestList->size()) { +@@ -113,7 +114,6 @@ + utestList = new vector<UTest>; + + catch_signal(); +- atexit(runSummaryAtExit); + } + utestList->push_back(*this); + } diff --git a/lang/beignet/files/patch-utests_utest__math__gen.py b/lang/beignet/files/patch-utests_utest__math__gen.py new file mode 100644 index 000000000000..faa6ebd4c846 --- /dev/null +++ b/lang/beignet/files/patch-utests_utest__math__gen.py @@ -0,0 +1,18 @@ +--- utests/utest_math_gen.py.orig 2015-02-02 20:01:26 UTC ++++ utests/utest_math_gen.py +@@ -241,10 +241,11 @@ static float atan2pi(float y, float x){ + exp2Utests = func('exp2','exp2',[exp2_input_type],exp2_output_type,[exp2_input_values],'4 * FLT_ULP') + + ##### gentype exp10(gentype) +- exp10_input_values = base_input_values +- exp10_input_type = ['float','float2','float4','float8','float16'] +- exp10_output_type = ['float','float2','float4','float8','float16'] +- exp10Utests = func('exp10','exp10',[exp10_input_type],exp10_output_type,[exp10_input_values],'4 * FLT_ULP') ++# exp10_input_values = base_input_values ++# exp10_input_type = ['float','float2','float4','float8','float16'] ++# exp10_output_type = ['float','float2','float4','float8','float16'] ++# exp10Utests = func('exp10','exp10',[exp10_input_type],exp10_output_type,[exp10_input_values],'4 * FLT_ULP') ++# FreeBSD does not have a exp10() function + + ##### gentype expm1(gentype x) + expm1_input_values = base_input_values diff --git a/lang/beignet/pkg-descr b/lang/beignet/pkg-descr new file mode 100644 index 000000000000..4922f3a687f1 --- /dev/null +++ b/lang/beignet/pkg-descr @@ -0,0 +1,6 @@ +Beignet contains the code to run OpenCL programs on Intel GPUs, which +defines and implements host functions required to initialize the device, +create the command queues, the kernels, and the programs and run them on +the GPU. It also contains the compiler part of the stack. + +WWW: https://01.org/beignet/ diff --git a/lang/beignet/pkg-plist b/lang/beignet/pkg-plist new file mode 100644 index 000000000000..3188fe039312 --- /dev/null +++ b/lang/beignet/pkg-plist @@ -0,0 +1,26 @@ +etc/OpenCL/vendors/intel-beignet.icd +lib/beignet/beignet.bc +lib/beignet/beignet.pch +lib/beignet/include/ocl.h +lib/beignet/include/ocl_as.h +lib/beignet/include/ocl_async.h +lib/beignet/include/ocl_atom.h +lib/beignet/include/ocl_common.h +lib/beignet/include/ocl_convert.h +lib/beignet/include/ocl_defines.h +lib/beignet/include/ocl_float.h +lib/beignet/include/ocl_geometric.h +lib/beignet/include/ocl_image.h +lib/beignet/include/ocl_integer.h +lib/beignet/include/ocl_math.h +lib/beignet/include/ocl_misc.h +lib/beignet/include/ocl_printf.h +lib/beignet/include/ocl_relational.h +lib/beignet/include/ocl_simd.h +lib/beignet/include/ocl_sync.h +lib/beignet/include/ocl_types.h +lib/beignet/include/ocl_vload.h +lib/beignet/include/ocl_workitem.h +lib/beignet/libcl.so +lib/beignet/libgbe.so +lib/beignet/libgbeinterp.so diff --git a/lang/clover/Makefile b/lang/clover/Makefile new file mode 100644 index 000000000000..31268c07c86d --- /dev/null +++ b/lang/clover/Makefile @@ -0,0 +1,39 @@ +# $FreeBSD$ + +PORTNAME= clover +PORTVERSION= ${MESAVERSION} +PORTREVISION= 0 +CATEGORIES= lang + +COMMENT= Mesa "Clover" OpenCL library + +BUILD_DEPENDS= opencl>=0:${PORTSDIR}/devel/opencl +LIB_DEPENDS= libdrm.so:${PORTSDIR}/graphics/libdrm \ + libOpenCL.so:${PORTSDIR}/devel/ocl-icd \ + libexpat.so:${PORTSDIR}/textproc/expat2 +RUN_DEPENDS= opencl>=0:${PORTSDIR}/devel/opencl + +USE_XORG= glproto x11 xext xxf86vm xdamage xfixes dri2proto \ + presentproto xvmc xshmfence + +ONLY_FOR_ARCHS= i386 amd64 powerpc64 +ONLY_FOR_ARCHS_REASON= Clover needs a graphics driver supported by the Radeon KMS driver + +.include <bsd.port.options.mk> +.include "${.CURDIR}/../../graphics/libGL/Makefile.common" + +#MESA_BUILD_WRKSRC= src/util src/glsl src/mesa src/gallium +MESA_INSTALL_WRKSRC= src/gallium/targets/opencl src/gallium/targets/pipe-loader + +.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1001514 && ${ARCH} == powerpc64 +IGNORE= Clover is only support on powerpc64 in FreeBSD 10.2 +.elif ${OPSYS} == FreeBSD && ${OSVERSION} < 1000000 && ${ARCH} != powerpc64 +IGNORE= Clover is only supported on FreeBSD 10.1 and newer +.endif + +.include "${.CURDIR}/../../graphics/libGL/Makefile.targets" + +post-install: + @${MV} ${STAGEDIR}/etc/OpenCL ${STAGEDIR}${PREFIX}/etc/ + +.include <bsd.port.mk> diff --git a/lang/clover/pkg-descr b/lang/clover/pkg-descr new file mode 100644 index 000000000000..0385eee7880f --- /dev/null +++ b/lang/clover/pkg-descr @@ -0,0 +1,5 @@ +This package contains the Mesa "Clover" libOpenCL implementation. This +implementation is build onto GALLIUM and as such can only be used on Radeon +cards. + +WWW: http://dri.freedesktop.org/wiki/GalliumCompute/ diff --git a/lang/clover/pkg-plist b/lang/clover/pkg-plist new file mode 100644 index 000000000000..5686603b7ee4 --- /dev/null +++ b/lang/clover/pkg-plist @@ -0,0 +1,9 @@ +etc/OpenCL/vendors/mesa.icd +lib/gallium-pipe/pipe_r300.so +lib/gallium-pipe/pipe_r600.so +lib/gallium-pipe/pipe_radeonsi.so +lib/gallium-pipe/pipe_swrast.so +lib/gallium-pipe/pipe_vmwgfx.so +lib/libMesaOpenCL.so +lib/libMesaOpenCL.so.1 +lib/libMesaOpenCL.so.1.0.0 |