summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
AgeCommit message (Collapse)AuthorFilesLines
2017-03-01Add AppStream metadataRebecca N. Palmer1-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>
2017-02-14Enable OpenCL 2.0 only where supportedPan Xiuli1-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>
2017-02-10CMAKE: if user disable ICD support, must pass cmake option explicitly.Yang Rong1-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>
2017-02-10Add example of using cl_khr_gl_sharing to do gl buffer sharing.Chuanbo Weng1-17/+17
Signed-off-by: Chuanbo Weng <chuanbo.weng@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2017-02-07Add a CMake option for toggling OCL ICD Loader compatibilityMarek Szuba1-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>
2017-01-20Bump version to 1.4.Yang Rong1-1/+1
2016-12-30CMake: add an option to enable OpenCL 2.0.Yang, Rong R1-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>
2016-12-02disable CMRT as default, since no real case reportedGuo, Yejun1-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>
2016-11-08OCL20: Add OpenCL2.0 apis to icd.Yang Rong1-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>
2016-11-08OCL20: Add svm support.Yang Rong1-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>
2016-09-12Runtime: re-enable cl_khr_gl_sharing with existing egl extension.Chuanbo Weng1-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>
2016-08-30Bump version to 1.3.Yang Rong1-1/+1
2016-07-20CMAKE: Make utests and benchmark not build for defaultPan Xiuli1-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>
2016-07-06Runtime: set the sub slice according to kernel pooled EU configure.Yang Rong1-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>
2016-06-30CMAKE: Use DRM_INTEL_LIBDIR for CHECK_LIBRARY_EXISTS pathPan Xiuli1-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>
2016-06-23CMake: use CHECK_LIBRARY_EXISTS to check the function instead of version.Yang Rong1-11/+14
Signed-off-by: Yang Rong <rong.r.yang@intel.com> Reviewed-by: Ruiling Song <ruiling.song@intel.com>
2016-05-25CMakeLists: respect existing CMAKE_C/CXX_FLAGSRoss Burton1-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>
2016-04-22standalone utest for unified OpenCL implementation.Luo Xionghu1-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>
2015-12-23Runtime: because double's built-ins haven't completely support, so disable ↵Yang Rong1-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>
2015-12-09make Beignet as intermedia layer of CMRTGuo Yejun1-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>
2015-11-17First reference beignet's CL header to buildZhenyu Wang1-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>
2015-07-31Bump master version to 1.2.Yang Rong1-1/+1
1.1.x series will be maintained on Release_v1.1 branch. Signed-off-by: Yang Rong <rong.r.yang@intel.com>
2015-06-19Add example to show v4l2 buffer sharing with extension clGetMemObjectFdIntel.Chuanbo Weng1-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>
2015-03-24BUGFIX: Prohibit 'make package' from doing system install of ICD vendor fileBrian Kloppenborg1-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>
2015-03-19Query the driver directly for compute units and subsliceJeff McGee1-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>
2015-03-19Build: fix the beignet icd name when CMAKE_INSTALL_FULL_LIBDIR is undefined.Zhigang Gong1-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>
2015-03-16Bump to 1.1Zhigang Gong1-1/+1
This is the dev branch for next major release 1.1.0. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
2015-03-02Build: use -Bsymbolic to fix conflicts with other LLVM users.Zhigang Gong1-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>
2015-02-27Enable multiarch (32/64-bit co-installation)Rebecca N. Palmer1-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>
2015-02-11remove unsafe define -D__$(USER)__Andreas Beckmann1-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>
2015-02-06Add example to show libva buffer sharing with extension ↵Chuanbo Weng1-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>
2015-01-12only build tests that do not need compiler when standalone compiler is providedGuo Yejun1-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>
2015-01-12add CMake option USE_STANDALONE_GBE_COMPILER and STANDALONE_GBE_COMPILER_DIRGuo Yejun1-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>
2014-12-25Remove deprecated fulsim codeZhenyu Wang1-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>
2014-12-15CL: Don't find mesa source code.Zhigang Gong1-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>
2014-12-15Fix a makefile bug for gcc is not the default compilerLv Meng1-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>
2014-11-19re-enable userptr with fix: CPU access after GPU finishes the renderingGuo Yejun1-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>
2014-11-18Remove patch version on master branch.Zhigang Gong1-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>
2014-11-14Bump to 1.0.0.Release_v1.0.0Zhigang Gong1-2/+3
Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
2014-11-13runtime: disable userptr due to random fail.Zhigang Gong1-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>
2014-11-07support CL_MEM_USE_HOST_PTR with userptr for cl bufferGuo Yejun1-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>
2014-10-14Let the failure of intel_drm lib's check as a FATAL_ERRORJunyan He1-1/+1
Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2014-10-14Add the libdrm version check.Junyan He1-1/+1
Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2014-09-16Fix the bug of LLVM_LFLAGS fail to setJunyan He1-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>
2014-09-12Enable ICC and CLANG compiler for beignetLv Meng1-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>
2014-09-02remove dependency for non-X runtime environmentGuo Yejun1-5/+6
Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2014-08-13cmake: Fix a license issue.Ruiling Song1-7/+0
Signed-off-by: Ruiling Song <ruiling.song@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2014-07-08Build: Change versioning policy.Zhigang Gong1-1/+0
Don't set patch version number on master branch. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
2014-06-30Bump to 0.9.1 (development version).Zhigang Gong1-1/+1
Bump to development version after 0.9.0. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
2014-06-26Bump to version 0.9.Release_v0.9Zhigang Gong1-2/+2
Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>