* Split examples into those that require runtime compilation of
  kernels (opencl-examples-runtime) and those that use prebuilt
  kernels (opencl-examples-offline).
* Retain opencl-examples as the package to bring in all examples.
* Adjust package dependencies accordingly.

Signed-off-by: Jacob Stiffler <[email protected]>
---
 .../recipes-ti/ocl/opencl-examples_git.bb          | 42 +++++++++++++++++++---
 1 file changed, 37 insertions(+), 5 deletions(-)

diff --git a/meta-arago-extras/recipes-ti/ocl/opencl-examples_git.bb 
b/meta-arago-extras/recipes-ti/ocl/opencl-examples_git.bb
index 4732c73..fe09b90 100644
--- a/meta-arago-extras/recipes-ti/ocl/opencl-examples_git.bb
+++ b/meta-arago-extras/recipes-ti/ocl/opencl-examples_git.bb
@@ -16,12 +16,27 @@ OCL_PERSISTENT_DEPENDS = "ti-xdctools-native ti-ipc-rtos 
ti-sysbios"
 
 DEPENDS_append_dra7xx = " ${OCL_PERSISTENT_DEPENDS}"
 
-RDEPENDS_${PN} += " opencl-runtime"
-RDEPENDS_${PN}-dev += " libgomp-dev"
+PACKAGES =+ "${PN}-runtime ${PN}-runtime-dbg ${PN}-offline ${PN}-offline-dbg"
+
+RDEPENDS_${PN} = "${PN}-runtime ${PN}-offline"
+RDEPENDS_${PN}-dev += "libgomp-dev"
+RDEPENDS_${PN}-offline += "opencl"
+RDEPENDS_${PN}-runtime += "opencl-runtime"
 
 S = "${WORKDIR}/git/opencl_example_src"
 B = "${S}"
 
+OCL_RUNTIME_COMPILE_EXAMPLE_LIST = " \
+    ccode \
+    null \
+    ooo_callback \
+    simple \
+    vecadd \
+    vecadd_openmp \
+    vecadd_openmp_t \
+    vecadd_subdevice \
+"
+
 OCL_EXAMPLE_LIST = " abort_exit \
                      buffer \
                      ccode \
@@ -100,12 +115,29 @@ do_install() {
     done
 }
 
-FILES_${PN} += "\
-    ${datadir}/ti/examples/opencl \
+# First package the examples which require run-time kernel compilation.
+FILES_${PN}-runtime += "\
+    ${@' '.join(['${datadir}/ti/examples/opencl/' + example for example in 
d.getVar('OCL_RUNTIME_COMPILE_EXAMPLE_LIST').split()])} \
+"
+
+FILES_${PN}-runtime-dbg += "\
+    ${@' '.join(['${datadir}/ti/examples/opencl/' + example + '/.debug' for 
example in d.getVar('OCL_RUNTIME_COMPILE_EXAMPLE_LIST').split()])} \
+"
+
+# Remaining examples will fall through to the "offline" package.
+FILES_${PN}-offline += "\
+    ${datadir}/ti/examples/opencl/ \
 "
 
-FILES_${PN}-dbg += "\
+FILES_${PN}-offline-dbg += "\
     ${datadir}/ti/examples/opencl/*/.debug \
 "
 
+# Add makefiles to dev package
+FILES_${PN}-dev = "${datadir}/ti/examples/opencl/Makefile \
+                   ${datadir}/ti/examples/opencl/make.inc"
+
+ALLOW_EMPTY_${PN} = "1"
 INSANE_SKIP_${PN} = "arch ldflags textrel staticdev"
+INSANE_SKIP_${PN}-offline = "arch ldflags textrel staticdev"
+INSANE_SKIP_${PN}-runtime = "arch ldflags textrel staticdev"
-- 
2.7.4

_______________________________________________
meta-arago mailing list
[email protected]
http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago

Reply via email to