summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
Commit message (Collapse)AuthorAgeFilesLines
* cmake: add option OCL_ICD_INSTALL_PREFIX to set icd file install path.Yang, Rong R2017-07-271-12/+15
| | | | | | | | It is for the user who don't has root permission. V2: change to option name to OCL_ICD_INSTALL_PREFIX. Signed-off-by: Yang Rong <rong.r.yang@intel.com> Reviewed-by: Ruiling Song <ruiling.song@intel.com>
* Add AppStream metadataRebecca N. Palmer2017-03-011-0/+5
| | | | | | | | | AppStream is a standard for software metadata, including what hardware a driver supports: https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html Signed-off-by: Rebecca N. Palmer <rebecca_palmer@zoho.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* Enable OpenCL 2.0 only where supportedPan Xiuli2017-02-141-14/+32
| | | | | | | | | | | | | | This allows a single beignet binary to both offer 2.0 where available, and still work on older hardware. V2: Default to 1.2 when -cl-std is not set (required by the OpenCL spec, and also likely to be faster). V3: Only enable OpenCL 2.0 when llvm version is 39. V4: Only enable OpenCL 2.0 on x64 host. V5: Always return 32 as address bits. Contributor: Rebecca N. Palmer <rebecca_palmer@zoho.com> Signed-off-by: Pan Xiuli <xiuli.pan@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* CMAKE: if user disable ICD support, must pass cmake option explicitly.Yang Rong2017-02-101-0/+1
| | | | | | | Also update readme aoubt ocl-icd section. Signed-off-by: Yang Rong <rong.r.yang@intel.com> Reviewed-by: Pan Xiuli <xiuli.pan@intel.com>
* Add example of using cl_khr_gl_sharing to do gl buffer sharing.Chuanbo Weng2017-02-101-17/+17
| | | | | Signed-off-by: Chuanbo Weng <chuanbo.weng@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* Add a CMake option for toggling OCL ICD Loader compatibilityMarek Szuba2017-02-071-0/+3
| | | | | | | | | | | | | | The new option allows anyone wishing to do so to explicitly disable OCL ICD Loader support in Beignet, regardless of the presence or absence of OCL ICD header files. This is particularly useful for people building Beignet packages for distributions, as it avoids creating an implicit dependency on the state of the build host. The new option defaults to ON so the default behaviour of CMake configuration remains unchanged. See also: https://bugs.freedesktop.org/show_bug.cgi?id=98885 Signed-off-by: Marek Szuba <Marek.Szuba@cern.ch> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* Bump version to 1.4.Yang Rong2017-01-201-1/+1
|
* CMake: add an option to enable OpenCL 2.0.Yang, Rong R2016-12-301-15/+41
| | | | | | | | | | The OpenCL 2.0 is disable default, to enable it, using option -DENABLE_OPENCL_20 to enable it. Now skylake and newer devices support OpenCL 2.0, if enable OpenCL 2.0, LLVM 3.9 and libdrm 2.4.66 is required. Signed-off-by: Yang Rong <rong.r.yang@intel.com> Reviewed-by: Pan Xiuli <xiuli.pan@intel.com>
* disable CMRT as default, since no real case reportedGuo, Yejun2016-12-021-0/+5
| | | | | | | | and this feature also sometimes introduces build issue. v2: add option INVOKE_CMRT to enable CMRT if necessary Signed-off-by: Guo, Yejun <yejun.guo@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* OCL20: Add OpenCL2.0 apis to icd.Yang Rong2016-11-081-2/+7
| | | | | | | Also set the LIBCL_C_VERSION to 2.0 Signed-off-by: Yang Rong <rong.r.yang@intel.com> Reviewed-by: "Song, Ruiling" <ruiling.song@intel.com>
* OCL20: Add svm support.Yang Rong2016-11-081-2/+3
| | | | | | | | | | | | Enable CL_DEVICE_SVM_COARSE_GRAIN_BUFFER svm support, use userptr and softpin to implement it. Use userptr to share the page between cpu and gpu, and softpin to unify the cpu and gpu's address. Now it works on i386 system. x86_64 depends on backend support. This patch base on DRM library and DRM kernel driver's softpin patch: http://lists.freedesktop.org/archives/intel-gfx/2015-September/075446.html. Signed-off-by: Yang Rong <rong.r.yang@intel.com> Reviewed-by: "Song, Ruiling" <ruiling.song@intel.com>
* Runtime: re-enable cl_khr_gl_sharing with existing egl extension.Chuanbo Weng2016-09-121-23/+16
| | | | | | | | | | | | | | | | | | In order to query low level layout of GL buffer object/texture/render buffer, previous implementation introduced an egl extension and implemented in Beignet side. This way is broken once mesa change its related internal code. In this patch, we use an new egl extension (EGL_MESA_image_dma_buf_export) to query related layout infomations of gl texture. Since this egl extension is already accepted by Khronos, so it's a stable method. This patch just implement GL texture 2d buffer sharing, and we will implement other target type if necessary. v2: Add CMake build option to enable cl_khr_gl_sharing(default off). Clean up related CMake code. Signed-off-by: Chuanbo Weng <chuanbo.weng@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* Bump version to 1.3.Yang Rong2016-08-301-1/+1
|
* CMAKE: Make utests and benchmark not build for defaultPan Xiuli2016-07-201-2/+2
| | | | | | | | | | Now make will only make beignet library, if you want beignet utest or benchmark you can use make utest and make benchmark to build them. This will make build time for beignet shorter when utests are not needed. Signed-off-by: Pan Xiuli <xiuli.pan@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* Runtime: set the sub slice according to kernel pooled EU configure.Yang Rong2016-07-061-0/+12
| | | | | | | | | | | | | If BXT pooled EU enable, the 3*6 EUs is split into 2 pooled, so change the sub slice to 2. For min no. of eu in pool, only affact fused down 2*6 BXT devices, because beignet don't support these devices now, add assert only. assert. This patch is based on kernel patch: https://patchwork.freedesktop.org/series/8200/ Thanks Arun. Signed-off-by: Yang Rong <rong.r.yang@intel.com>
* CMAKE: Use DRM_INTEL_LIBDIR for CHECK_LIBRARY_EXISTS pathPan Xiuli2016-06-301-3/+3
| | | | | | | | We check libdrm-intel with pkg-config, but CHECK_LIBRARY_EXISTS may search lib in different path, so add the path we will use for it. Signed-off-by: Pan Xiuli <xiuli.pan@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@intel.com>
* CMake: use CHECK_LIBRARY_EXISTS to check the function instead of version.Yang Rong2016-06-231-11/+14
| | | | | Signed-off-by: Yang Rong <rong.r.yang@intel.com> Reviewed-by: Ruiling Song <ruiling.song@intel.com>
* CMakeLists: respect existing CMAKE_C/CXX_FLAGSRoss Burton2016-05-251-2/+2
| | | | | | | | Instead of replacing the existing CMAKE_C_FLAGS and CMAKE_CXX_FLAGS, extend them so that existing assignments (from e.g. toolchain files) are preserved. Signed-off-by: Ross Burton <ross.burton@intel.com> Reviewed-by: Guo, Yejun <yejun.guo@intel.com>
* standalone utest for unified OpenCL implementation.Luo Xionghu2016-04-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | use the variable NOT_BUILD_STAND_ALONE_UTEST to control the build type: for beignet build, set it to 1; for stand alone build, do NOT need set it. remove all clXXXIntel extension call and such kind of tests since we intend to provide the unit test independently for viariant OpenCL implementation; replace the clMapBufferIntel/clMapBufferGTTIntel with clEnqueueMapBuffer/clEnqueueMapImage; link the utest binary to libOpenCL to follow the icd standard; remove the useless env in setenv.sh since we need make install the package after build. v2: fix the indent error; use function pointer for extesion case like vme and libva since we link to libOpenCL; v3: builtin_kernel_block_motion_estimate_intel released kernel twice; v4: find OpenCL library for standalone utest and link to libcl for not standalone utest; check default variables in setenv.sh whether empty before use. Signed-off-by: Luo Xionghu <xionghu.luo@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* Runtime: because double's built-ins haven't completely support, so disable ↵Yang Rong2015-12-231-0/+6
| | | | | | | | | it by default. Add a cmake option for it, cmake with option -DEXPERIMENTAL_DOUBLE=true to enable it. Signed-off-by: Yang Rong <rong.r.yang@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@intel.com>
* make Beignet as intermedia layer of CMRTGuo Yejun2015-12-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | CMRT is C for Media Runtime on Intel GPU, see https://github.com/01org/cmrt. There is a request to make Beignet as intermedia layer of CMRT, in other words, application programer write OpenCL APIs to execute the CM kernel on GPU, the following shows the key code, and please refer to the next patch of unit test for detail. prog = clCreateProgramWithBinary("cm kernel"); clBuildProgram(prog); kernel = clCreateKernel(prog, "kernel name"); image = clCreateImage(); clSetKernelArg(kernel, image); clEnqueueNDRangeKernel(kernel); Inside Beignet, once cm kernel is invoked, the following relative APIs will be directly passed to CMRT library (libcmrt.so) which is loaded via dlopen only when necessary. Since we use this simple method to keep the code clean, OpenCL spec is not strictly followed, and cl_event is not supported for this case. v2: add comments about the cm queue in fuction cmrt_enqueue Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* First reference beignet's CL header to buildZhenyu Wang2015-11-171-1/+3
| | | | | | | | | | | This is to fix build error when new intel extension is added into beignet. As current cmake rule will use old system installed CL headers instead of beignet ones, which leads to compile failure as new extension definition won't be found. So this trys to simply always prefer to use beignet's CL header in build/install. Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com> Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
* Bump master version to 1.2.Yang Rong2015-07-311-1/+1
| | | | | | 1.1.x series will be maintained on Release_v1.1 branch. Signed-off-by: Yang Rong <rong.r.yang@intel.com>
* Add example to show v4l2 buffer sharing with extension clGetMemObjectFdIntel.Chuanbo Weng2015-06-191-14/+21
| | | | | | | | | | | | | | | | | This example captures yuy2 frame directly to cl buffer object by the way of dma, processed by OpenCL kernel, then convert to nv12 format and shown by libva. v2: Close cl buffer's fd by clCloseMemObjectFdIntel instead of close function. v3: Just use close function, no need of clCloseMemObjectFdIntel. v4: Some modifcation of examples/CMakeLists.txt after code rebase. Signed-off-by: Chuanbo Weng <chuanbo.weng@intel.com> Reviewed-by: Yuan, Feng <feng.yuan@intel.com>
* BUGFIX: Prohibit 'make package' from doing system install of ICD vendor fileBrian Kloppenborg2015-03-241-0/+1
| | | | | | | | | | | | As presently written, a 'make package' will attempt to INSTALL the Beignet ICD loader to /etc/OpenCL/vendors whereas it should just do a local install and then package the file. The proposed change instructs CPack to include the `DESTDIR` variable when it calls `make install`, thus directing the desination for the ICD loader to a local directory instead of a system path. Signed-off-by: Brian Kloppenborg <brian@arrayfire.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* Query the driver directly for compute units and subsliceJeff McGee2015-03-191-0/+9
| | | | | | | | | | | | | | | | | | | | Values of device max compute units and max subslice obtained directly from the driver should be more accurate than our own ID-based lookup values. This is particularly important when a single device ID may encompass more than one configuration. If the driver cannot provide a valid value for the given device, we fallback on the ID-based lookup value. This query requires libdrm 2.4.60. For now we will consider the use of this query to be optional and exclude it from compilation when building against older libdrm. Later we may want to consider requiring the query or at least warning more strongly when it is not supported. v2: Make feature use conditional on libdrm version (Zhigang). Signed-off-by: Jeff McGee <jeff.mcgee@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* Build: fix the beignet icd name when CMAKE_INSTALL_FULL_LIBDIR is undefined.Zhigang Gong2015-03-191-2/+8
| | | | | | | | | | On some distributions, the CMAKE_INSTALL_FULL_LIBDIR or CMAKE_LIBRARY_ARCHITECTURE may be undefined. To avoid generate intel-beignet-.icd file name, we need to get rid of the extra "-" for such case. Reported by Igor Gnatenko. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
* Bump to 1.1Zhigang Gong2015-03-161-1/+1
| | | | | | This is the dev branch for next major release 1.1.0. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
* Build: use -Bsymbolic to fix conflicts with other LLVM users.Zhigang Gong2015-03-021-1/+1
| | | | | | | | | | | | As there may be some other LLVM users such as mesa, and they may link to different LLVM library. To avoid such type of conflicts, we use -Bsymbolic to disable the symbol preemption. This patch should fix the build bug at: https://bugs.freedesktop.org/show_bug.cgi?id=89325 Signed-off-by: Zhigang Gong <zhigang.gong@intel.com> Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
* Enable multiarch (32/64-bit co-installation)Rebecca N. Palmer2015-02-271-3/+18
| | | | | | | | | | | | | | | | | | | | | It is currently not possible to have 32- and 64-bit builds of beignet installed on the same system, as the path in intel-beignet.icd can only be one of the two installations. This fixes this by giving this file a different name when beignet is installed in a multiarch directory: intel-beignet-i386-linux-gnu.icd -> /usr/lib/i386-linux-gnu/beignet/libCL.so intel-beignet-x86_64-linux-gnu.icd -> /usr/lib/x86_64-linux-gnu/beignet/libCL.so Discussion and possible alternative approaches: http://lists.alioth.debian.org/pipermail/pkg-opencl-devel/Week-of-Mon-20150223/date.html While preparing this patch I noticed that intel-beignet.icd.in uses @LIB_INSTALL_DIR@/beignet/ rather than @BEIGNET_INSTALL_DIR@, which will obviously break if the latter is set directly. Is that a bug or is this intended to be an internal-only variable? Signed-off-by: Rebecca Palmer <rebecca_palmer@zoho.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* remove unsafe define -D__$(USER)__Andreas Beckmann2015-02-111-2/+0
| | | | | | | | | | funny things may happen with usernames like 'asm', 'attribute', 'x86_64', 'i386', and so on this breaks on usernames with non-alnum chars ('-', '.') Signed-off-by: Andreas Beckmann <anbe@debian.org> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* Add example to show libva buffer sharing with extension ↵Chuanbo Weng2015-02-061-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clCreateImageFromLibvaIntel. This example reads a source nv12 file to a VASurface, and creates a target VASurface. Then creates corresponding cl image objects from them. After using ocl to do mirror effect post-processing on source VASurface, target VASurface is shown on screen by default. Code of loading nv12 file to VASurface are referenced from libva/test/encode/avcenc.c. v2: Delete 1920x1080.nv12 and 640x480.nv12 because of large size, add 256_128.nv12 as default test image. v3: 1. Re-org files: add libva as a submodule then use display related files. 2. Show result on screen by default instead of saving as a file. 3. Fix warnings. v4: Fix whitespace format warnings. v5: 1. Modify upload_nv12_to_surface to read a nv12 file and then upload it to an NV12 VASurface. Also modify store_surface_to_nv12. 2. Change the cl post-processing kernel from gray effect to mirror effect, which make demo cooler. 3. Minor fix of other problems. v6: Remove unnecessary OUTPUT_NV12_DEFAULT related code. Signed-off-by: Chuanbo Weng <chuanbo.weng@intel.com> Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Reviewed-by: "Guo, Yejun" <yejun.guo@intel.com>
* only build tests that do not need compiler when standalone compiler is providedGuo Yejun2015-01-121-0/+4
| | | | | | | | | | | | | | the built test case is load_program_from_bin_file, it demos how to generate from source kernel compiler_ceil.cl to binary kernel compiler_ceil.bin with the standalone compiler for a specific gen pci id, and also demos how to load and execute the binary kernel when the compiler is not available in the running system. btw, please make sure compiler_ceil.bin is really updated if there is already one there, the safe way is to delete it first. Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* add CMake option USE_STANDALONE_GBE_COMPILER and STANDALONE_GBE_COMPILER_DIRGuo Yejun2015-01-121-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | At some platforms with old c/c++ environment, C++11 features are not supported, it results in the failure to build the gbe compiler part which depends on LLVM/clang using C++11 features. The way to resolve is to build a standalone gbe compiler within another feasible system, and build beignet with the already built standalone gbe compiler by setting USE_STANDALONE_GBE_COMPILER=true. The path of the standalone compiler is /usr/local/lib/beignet as default or could be specified by STANDALONE_GBE_COMPILER_DIR. Once USE_STANDALONE_GBE_COMPILER is given, all the gbe compiler relative code will not be built any longer, only libcl.so and libgebinterp.so are built. And libcl.so is special for GEN_PCI_ID, which is queried from the building machie or could be specified as CMake option. v2: separate the CMake option name. update the commit comments. add back the script for gen pci id, and build driver with it. v3: add file FindStandaloneGbeCompiler.cmake to make the main cmakefile clean. Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* Remove deprecated fulsim codeZhenyu Wang2014-12-251-23/+1
| | | | | | | | | | | Remove pretty old fulsim code which seems having no users also used interfaces not in open source libdrm, and call windows fulsim binary instead of linux. We will use current libdrm interface instead. Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* CL: Don't find mesa source code.Zhigang Gong2014-12-151-6/+6
| | | | | | | | As build with mesa has been broken for a long time, we disable it to avoid potential build problem. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com> Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
* Fix a makefile bug for gcc is not the default compilerLv Meng2014-12-151-2/+9
| | | | | | | | | If no compiler macro is defined and the system only has clang or icc, the previous implementation will treat clang as gcc and will set some incorrect parameters. Now fix it. Signed-off-by: Lv Meng <meng.lv@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* re-enable userptr with fix: CPU access after GPU finishes the renderingGuo Yejun2014-11-191-7/+6
| | | | | | | | | 1. the wait logic is integrated into function cl_mem_map/unmap_auto 2. use cl_mem_map/unmap_auto for userptr inside clEnqueueRead/WriteBuffer 3. do not use cl_buffer_subdata for userptr, use cl_mem_map/memcpy instead Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* Remove patch version on master branch.Zhigang Gong2014-11-181-1/+0
| | | | | | | Master branch is for the next major release. 1.0.x series will be maintained on Release_v1.0 branch. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
* Bump to 1.0.0.Release_v1.0.0Zhigang Gong2014-11-141-2/+3
| | | | Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
* runtime: disable userptr due to random fail.Zhigang Gong2014-11-131-6/+7
| | | | | | | | We get a random fail when enable userptr. Disable it before we root cause and fix it. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com> Reviewed-by: "Guo, Yejun" <yejun.guo@intel.com>
* support CL_MEM_USE_HOST_PTR with userptr for cl bufferGuo Yejun2014-11-071-2/+9
| | | | | | | | | | | | | | | | | | | userptr is used to wrap a memory pointer (page aligned) supplied by user space into a buffer object accessed by GPU, and so no extra copy is needed. It is supported starting from linux kernel 3.16 and libdrm 2.4.58. This patch is originally finished by Zhenyu Wang <zhenyuw@linux.intel.com>, I did a little change and some code clean. No regression issue found on IVB+Ubuntu14.10 with libdrm upgraded with tests: beignet/utests, piglit, OpenCV/test&perf, conformance/basic&mem_host_flags&buffers V2: add page align limit for data size, add comments for kernel without MMU_NOTIFIER V3: add runtime check with host_unified_memory, return CL_MEM_OBJECT_ALLOCATION_FAILURE if failed Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com> Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>
* Let the failure of intel_drm lib's check as a FATAL_ERRORJunyan He2014-10-141-1/+1
| | | | | Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* Add the libdrm version check.Junyan He2014-10-141-1/+1
| | | | | Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* Fix the bug of LLVM_LFLAGS fail to setJunyan He2014-09-161-1/+2
| | | | | | | | | The LLVM_LFLAGS is used before finding the LLVM package, which causes the CMake fails to set correct -L flags and cause linkage error. Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* Enable ICC and CLANG compiler for beignetLv Meng2014-09-121-5/+33
| | | | | | | the 'COMPILER' is to choose the detail compiler,the default is GCC. Signed-off-by: Lv Meng <meng.lv@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* remove dependency for non-X runtime environmentGuo Yejun2014-09-021-5/+6
| | | | | Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* cmake: Fix a license issue.Ruiling Song2014-08-131-7/+0
| | | | | Signed-off-by: Ruiling Song <ruiling.song@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* Build: Change versioning policy.Zhigang Gong2014-07-081-1/+0
| | | | | | Don't set patch version number on master branch. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
* Bump to 0.9.1 (development version).Zhigang Gong2014-06-301-1/+1
| | | | | | Bump to development version after 0.9.0. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>