-
Notifications
You must be signed in to change notification settings - Fork 54
Add beignet and other OpenCL components. #24
Changes from all commits
7becffc
cc68214
11cdcea
b0e7d1e
bbf771a
7e4c2a9
0e15d35
4fb9030
b603b89
40d630c
0e0d671
90ad7aa
bfe6233
ce8599f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| # Tests for computervision profile | ||
| oeqa.runtime.computervision.realsense_headless | ||
| oeqa.runtime.computervision.opencl_viennacl_1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| from oeqa.oetest import oeRuntimeTest | ||
|
|
||
| class OpenCLViennaCL1Test(oeRuntimeTest): | ||
| def test_opencl_viennacl_1(self): | ||
| # Run an example test from viennacl-examples | ||
| (status, output) = self.target.run('dense_blas-bench-opencl') | ||
| self.assertEqual(status, 0, msg="Error messages: %s" % output) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| # LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf | ||
| # changes incompatibly | ||
| LCONF_VERSION = "1" | ||
| LCONF_VERSION = "2" | ||
|
|
||
| BBPATH = "${TOPDIR}" | ||
| BBFILES ?= "" | ||
|
|
@@ -15,6 +15,7 @@ REFKIT_LAYERS = " \ | |
| ##OEROOT##/../meta-iotqa \ | ||
| ##OEROOT##/../meta-security-isafw \ | ||
| ##OEROOT##/../meta-intel-realsense \ | ||
| ##OEROOT##/../meta-clang \ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. a learning from meta-intel-realsense addition: we need to update the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, do you mean that we need to bump up
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes and also |
||
| " | ||
|
|
||
| # REFKIT_LAYERS += "##OEROOT##/../meta-openembedded/meta-efl" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| From dd07cf878a84662b684c0d59e6fd8effb341174e Mon Sep 17 00:00:00 2001 | ||
| From: Ismo Puustinen <ismo.puustinen@intel.com> | ||
| Date: Tue, 21 Feb 2017 15:13:59 +0200 | ||
| Subject: [PATCH] opencv: link dynamically against OpenCL library. | ||
|
|
||
| This removes the need for runtime /usr/lib/libOpenCL.so symlink. | ||
|
|
||
| Upstream-status: Inappropriate | ||
|
|
||
| Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com> | ||
| --- | ||
| cmake/OpenCVDetectOpenCL.cmake | 2 +- | ||
| 1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
|
||
| diff --git a/cmake/OpenCVDetectOpenCL.cmake b/cmake/OpenCVDetectOpenCL.cmake | ||
| index 433f244..5858945 100644 | ||
| --- a/cmake/OpenCVDetectOpenCL.cmake | ||
| +++ b/cmake/OpenCVDetectOpenCL.cmake | ||
| @@ -3,7 +3,7 @@ if(APPLE) | ||
| set(OPENCL_LIBRARY "-framework OpenCL" CACHE STRING "OpenCL library") | ||
| set(OPENCL_INCLUDE_DIR "" CACHE PATH "OpenCL include directory") | ||
| else(APPLE) | ||
| - set(OPENCL_LIBRARY "" CACHE STRING "OpenCL library") | ||
| + set(OPENCL_LIBRARY "-lOpenCL" CACHE STRING "OpenCL library") | ||
| set(OPENCL_INCLUDE_DIR "${OpenCV_SOURCE_DIR}/3rdparty/include/opencl/1.2" CACHE PATH "OpenCL include directory") | ||
| endif(APPLE) | ||
| mark_as_advanced(OPENCL_INCLUDE_DIR OPENCL_LIBRARY) | ||
| -- | ||
| 2.9.3 | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
|
|
||
| SRC_URI_append = " \ | ||
| file://0001-opencv-link-dynamically-against-OpenCL-library.patch \ | ||
| " | ||
|
|
||
| PACKAGECONFIG[opencl] = "-DWITH_OPENCL=ON,-DWITH_OPENCL=OFF,virtual/opencl-headers virtual/opencl-icd," |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,4 +7,5 @@ RDEPENDS_${PN} = " \ | |
| opencv-samples \ | ||
| python3-opencv \ | ||
| librealsense-examples \ | ||
| viennacl-examples \ | ||
| " | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,4 +9,5 @@ RDEPENDS_${PN} = " \ | |
| gstreamer1.0-plugins-good \ | ||
| libva-intel-driver \ | ||
| librealsense \ | ||
| packagegroup-opencl \ | ||
| " | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # From meta-clang (cb30aad4d6ff5e996f7a8c5837591071243dcd2c): | ||
| # | ||
| # Author: Mikko Ylinen <mikko.ylinen@linux.intel.com> | ||
| # Date: Mon Feb 13 18:06:00 2017 +0200 | ||
| # | ||
| # clang: set target DEPENDS for gcc TOOLCHAIN | ||
| # | ||
| # With the layer defaults (TOOLCHAIN ??= gcc) clang for target fails | ||
| # to build due to missing compilers in the native (recipe specific) | ||
| # sysroot. | ||
| # | ||
| # Set the necessary additional DEPENDS if TOOLCHAIN = gcc to get the | ||
| # compilers installed. | ||
| # | ||
| # Signed-off-by: Mikko Ylinen <mikko.ylinen@linux.intel.com> | ||
|
|
||
| DEPENDS_append_class-target = " clang-cross-${TARGET_ARCH} ${@bb.utils.contains('TOOLCHAIN', 'gcc', 'virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++', '', d)}" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Recipe for compiling beignet for Intel Joule 570x | ||
|
|
||
| require beignet.inc | ||
|
|
||
| EXTRA_OECMAKE_append = " -DGEN_PCI_ID=0x1A84" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Recipe for compiling beignet for Minnowboard Max | ||
|
|
||
| require beignet.inc | ||
|
|
||
| EXTRA_OECMAKE_append = " -DGEN_PCI_ID=0x0F31" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| LICENSE = "LGPLv2.1+" | ||
| LIC_FILES_CHKSUM = "file://COPYING;md5=6b566c5b4da35d474758324899cb4562" | ||
|
|
||
| SRC_URI = "git://anongit.freedesktop.org/beignet;nobranch=1 \ | ||
| file://fix-llvm-paths.patch \ | ||
| file://0001-api-mark-platform-not-supported-if-device-is-not-fou.patch \ | ||
| " | ||
| SRC_URI_append_class-native = " file://0001-reduced-native-for-1.3.0.patch" | ||
| SRC_URI_append_class-target = " file://0001-Run-native-gbe_bin_generater-to-compile-built-in-ker.patch" | ||
|
|
||
| BBCLASSEXTEND = "native" | ||
|
|
||
| # CMake cannot digest "+" in pathes -> replace it with dots. | ||
| PV = "1.3.0.${@ 'git${SRCPV}'.replace('+', '.')}" | ||
| SRCREV = "c8b47b1737402ff78151daec65c774d437f0b546" | ||
| S = "${WORKDIR}/git" | ||
|
|
||
| # we need to depend on ocl-icd, so that the exported symbols go right | ||
| DEPENDS = "${PN}-native clang libdrm mesa ocl-icd" | ||
| DEPENDS_class-native = "clang-native" | ||
|
|
||
| # To solve the PCI_ID problem, we use the target from filename for | ||
| # installing the library. | ||
|
|
||
| CL_HW_TARGET ?= "${@d.getVar('PN').split('-')[1]}" | ||
|
|
||
| # built-in kernels depend on libocl's headers (e.g. ocl_as.h) yet there is no | ||
| # dependency specified for that in beignet's build system. This causes race | ||
| # condition when libgbe.so is compiled for the target. | ||
| PARALLEL_MAKE = "" | ||
|
|
||
| inherit cmake pkgconfig | ||
|
|
||
| # There is no python in sysroot -> look for it on the build host. | ||
| # WARNING: remove CLang from the host otherwise it might get into use | ||
| # instead of the one from meta-clang. | ||
| OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH" | ||
|
|
||
| EXTRA_OECMAKE = " -DSTANDALONE_GBE_COMPILER_DIR=${STAGING_BINDIR_NATIVE} -DLLVM_LIBRARY_DIR=${STAGING_LIBDIR} -DBEIGNET_INSTALL_DIR=${libdir}/beignet-${CL_HW_TARGET}" | ||
| EXTRA_OECMAKE_class-native = " -DBEIGNET_INSTALL_DIR=/usr/lib/beignet -DLLVM_LIBRARY_DIR=${STAGING_LIBDIR_NATIVE}" | ||
|
|
||
| # TODO respect distrofeatures for x11 | ||
| PACKAGECONFIG ??= "" | ||
| PACKAGECONFIG[examples] = '-DBUILD_EXAMPLES=1,-DBUILD_EXAMPLES=0,libva' | ||
| # TODO: add explicit on/off upstream | ||
| PACKAGECONFIG[x11] = ",,libxext libxfixes" | ||
|
|
||
| FILES_${PN} += " \ | ||
| ${sysconfdir}/OpenCL/vendors/intel-beignet-${CL_HW_TARGET}.icd \ | ||
| ${libdir} \ | ||
| ${libdir}/beignet-${CL_HW_TARGET}/ \ | ||
| ${libdir}/beignet-${CL_HW_TARGET}/* \ | ||
| " | ||
|
|
||
| do_install_append_class-target () { | ||
| # Change the intel-beignet.icd file | ||
| rm ${D}${sysconfdir}/OpenCL/vendors/intel-beignet.icd | ||
| echo ${libdir}/beignet-${CL_HW_TARGET}/libcl.so > ${D}${sysconfdir}/OpenCL/vendors/intel-beignet-${CL_HW_TARGET}.icd | ||
| } | ||
|
|
||
| do_install_class-native() { | ||
| install -d ${D}${libdir}/cmake | ||
| install -m644 ${S}/CMake/FindStandaloneGbeCompiler.cmake ${D}${libdir}/cmake | ||
|
|
||
| install -d ${D}${bindir} | ||
| install ${B}/backend/src/gbe_bin_generater ${D}${bindir} | ||
| install ${B}/backend/src/libgbe.so ${D}${libdir} | ||
|
|
||
| install -d ${D}${bindir}/include | ||
| install ${B}/backend/src/libocl/usr/lib/beignet/include/* ${D}${bindir}/include | ||
| install ${B}/backend/src/libocl/usr/lib/beignet/beignet.bc ${D}${bindir}/ | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| From ea825ebc2ec47db4d3e794fef85de698c0f955a2 Mon Sep 17 00:00:00 2001 | ||
| From: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com> | ||
| Date: Tue, 14 Jun 2016 12:33:40 +0300 | ||
| Subject: [PATCH] Run native gbe_bin_generater to compile built-in kernels | ||
|
|
||
| Upstream-Status: Inappropriate [libgbe.so isn't supposed to be cross-compiled] | ||
|
|
||
| Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com> | ||
| --- | ||
| backend/CMakeLists.txt | 2 +- | ||
| 1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
|
||
| diff --git a/backend/CMakeLists.txt b/backend/CMakeLists.txt | ||
| index 915d60f..c3041bc 100644 | ||
| --- a/backend/CMakeLists.txt | ||
| +++ b/backend/CMakeLists.txt | ||
| @@ -58,6 +58,6 @@ set (GBE_BIN_GENERATER | ||
| PARENT_SCOPE) | ||
| else (USE_STANDALONE_GBE_COMPILER STREQUAL "true") | ||
| set (GBE_BIN_GENERATER | ||
| - ${GBE_BIN_GENERATER} LD_LIBRARY_PATH=${CMAKE_CURRENT_BINARY_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/src/gbe_bin_generater | ||
| + ${GBE_BIN_GENERATER} ${STANDALONE_GBE_COMPILER_DIR}/gbe_bin_generater | ||
| PARENT_SCOPE) | ||
| endif (USE_STANDALONE_GBE_COMPILER STREQUAL "true") | ||
| -- | ||
| 2.5.5 | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add this with
-b krogothThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added
branch = krogoth, I guess that's what you meant?