For opencl, use the runtime package to pull in the minimal set of
dependencies needed to run opencl applications. The applications must
use precompiled kernels. Use the main package to pull in the full set
of tools, including clocl and the accelerator toolchains.

For the opencl-examples, the offline-compile package are the examples
which provide precompiled kernels, and thus require the minimum set of
dependencies. The runtime-compile package requires the kernels to be
compiled during runtime, and thus require the full set of opencl
tools, including clocl.

Signed-off-by: Jacob Stiffler <[email protected]>
---
 .../recipes-ti/ocl/opencl-examples_git.bb          | 25 ++++++++++++----------
 meta-arago-extras/recipes-ti/ocl/opencl_git.bb     | 18 ++++++++++------
 2 files changed, 25 insertions(+), 18 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 fe09b90..bb7ff83 100644
--- a/meta-arago-extras/recipes-ti/ocl/opencl-examples_git.bb
+++ b/meta-arago-extras/recipes-ti/ocl/opencl-examples_git.bb
@@ -5,7 +5,7 @@ LICENSE = "BSD"
 include ocl.inc
 require recipes-ti/includes/ti-paths.inc
 
-PR = "${INC_PR}.0"
+PR = "${INC_PR}.1"
 
 COMPATIBLE_MACHINE = "dra7xx|keystone"
 PACKAGE_ARCH = "${MACHINE_ARCH}"
@@ -16,12 +16,15 @@ OCL_PERSISTENT_DEPENDS = "ti-xdctools-native ti-ipc-rtos 
ti-sysbios"
 
 DEPENDS_append_dra7xx = " ${OCL_PERSISTENT_DEPENDS}"
 
-PACKAGES =+ "${PN}-runtime ${PN}-runtime-dbg ${PN}-offline ${PN}-offline-dbg"
+# Split examples into two groups:
+# - offline-compile: examples who's kernels are precompiled (offline).
+# - runtime-compile: examples who's kernels are compiled during runtime.
+PACKAGES =+ "${PN}-runtime-compile ${PN}-runtime-compile-dbg 
${PN}-offline-compile ${PN}-offline-compile-dbg"
 
-RDEPENDS_${PN} = "${PN}-runtime ${PN}-offline"
+RDEPENDS_${PN} = "${PN}-runtime-compile ${PN}-offline-compile"
 RDEPENDS_${PN}-dev += "libgomp-dev"
-RDEPENDS_${PN}-offline += "opencl"
-RDEPENDS_${PN}-runtime += "opencl-runtime"
+RDEPENDS_${PN}-offline-compile += "opencl-runtime"
+RDEPENDS_${PN}-runtime-compile += "opencl"
 
 S = "${WORKDIR}/git/opencl_example_src"
 B = "${S}"
@@ -116,20 +119,20 @@ do_install() {
 }
 
 # First package the examples which require run-time kernel compilation.
-FILES_${PN}-runtime += "\
+FILES_${PN}-runtime-compile += "\
     ${@' '.join(['${datadir}/ti/examples/opencl/' + example for example in 
d.getVar('OCL_RUNTIME_COMPILE_EXAMPLE_LIST').split()])} \
 "
 
-FILES_${PN}-runtime-dbg += "\
+FILES_${PN}-runtime-compile-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 += "\
+FILES_${PN}-offline-compile += "\
     ${datadir}/ti/examples/opencl/ \
 "
 
-FILES_${PN}-offline-dbg += "\
+FILES_${PN}-offline-compile-dbg += "\
     ${datadir}/ti/examples/opencl/*/.debug \
 "
 
@@ -139,5 +142,5 @@ FILES_${PN}-dev = "${datadir}/ti/examples/opencl/Makefile \
 
 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"
+INSANE_SKIP_${PN}-offline-compile = "arch ldflags textrel staticdev"
+INSANE_SKIP_${PN}-runtime-compile = "arch ldflags textrel staticdev"
diff --git a/meta-arago-extras/recipes-ti/ocl/opencl_git.bb 
b/meta-arago-extras/recipes-ti/ocl/opencl_git.bb
index 7128c74..59cb8ca 100644
--- a/meta-arago-extras/recipes-ti/ocl/opencl_git.bb
+++ b/meta-arago-extras/recipes-ti/ocl/opencl_git.bb
@@ -4,13 +4,16 @@ LICENSE = "BSD"
 
 include ocl.inc
 
-PR = "${INC_PR}.0"
+PR = "${INC_PR}.1"
 
 inherit cmake systemd
 
 COMPATIBLE_MACHINE = "dra7xx|keystone"
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
+# Define runtime package for minimal dependencies to run opencl applications
+# which precompile the offloaded kernels. The base package will provide the
+# ability to compile kernels (clocl) during runtime.
 PACKAGES =+ "${PN}-runtime"
 
 MONITORS                      = " opencl-monitor"
@@ -40,11 +43,12 @@ DEPENDS_append_dra7xx   = " ti-ipc virtual/kernel"
 DEPENDS_append_keystone = " mpm-transport multiprocmgr"
 DEPENDS_remove_k2g = " libulm"
 
-RDEPENDS_${PN} += " bash ${MONITORS}"
+RDEPENDS_${PN}-runtime += " bash ${MONITORS}"
 RDEPENDS_${PN}-dev += " ocl-gl-headers-dev"
-RDEPENDS_${PN}-runtime += " ${PN} clocl"
+RDEPENDS_${PN} += " ${PN}-runtime clocl"
 
-ALLOW_EMPTY_${PN}-runtime = "1"
+# Use main package to pull in full support
+ALLOW_EMPTY_${PN} = "1"
 
 S = "${WORKDIR}/git/host"
 
@@ -73,10 +77,10 @@ do_install_append() {
     install -m0644 ${MCTD} ${D}${systemd_system_unitdir}/ti-mct-daemon.service
 }
 
-SYSTEMD_SERVICE_${PN} = "ti-mct-daemon.service"
-SYSTEMD_AUTO_ENABLE_${PN} = "${@oe.utils.conditional("RESERVE_CMEM", "1", 
"enable", "disable", d)}"
+SYSTEMD_SERVICE_${PN}-runtime = "ti-mct-daemon.service"
+SYSTEMD_AUTO_ENABLE_${PN}-runtime = "${@oe.utils.conditional("RESERVE_CMEM", 
"1", "enable", "disable", d)}"
 
-FILES_${PN}-runtime += "${bindir}"
+FILES_${PN}-runtime += "${bindir} ${systemd_system_unitdir}"
 
 FILES_${PN} += " \
     ${datadir}/ti/opencl/* \
-- 
2.7.4

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

Reply via email to