[meta-intel] [PATCH] mkl-dnn: add ptest

Naveen Saini naveen.kumar.saini at intel.com
Mon Jul 1 02:31:55 PDT 2019


Added api-c & test_c_symbols testcases under ptest.

Shipping benchdnn, which is a standalone correctness and performance
benchmark for Intel(R) Math Kernel Library for Deep
Neural Networks (Intel(R) MKL-DNN).

Signed-off-by: Naveen Saini <naveen.kumar.saini at intel.com>
---
 recipes-core/mkl-dnn/files/run-ptest | 15 +++++++++++++++
 recipes-core/mkl-dnn/mkl-dnn_git.bb  | 27 +++++++++++++++++++++++++--
 2 files changed, 40 insertions(+), 2 deletions(-)
 create mode 100755 recipes-core/mkl-dnn/files/run-ptest

diff --git a/recipes-core/mkl-dnn/files/run-ptest b/recipes-core/mkl-dnn/files/run-ptest
new file mode 100755
index 00000000..82d4df58
--- /dev/null
+++ b/recipes-core/mkl-dnn/files/run-ptest
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+cd tests
+./api-c
+if [ $? -eq 0 ]; then
+  echo 'PASS: api-c'
+else
+  echo 'FAIL: api-c'
+fi
+./test_c_symbols-c
+if [ $? -eq 0 ]; then
+  echo 'PASS: test_c_symbols-c'
+else
+  echo 'FAIL: test_c_symbols-c'
+fi
diff --git a/recipes-core/mkl-dnn/mkl-dnn_git.bb b/recipes-core/mkl-dnn/mkl-dnn_git.bb
index 2858d876..5846b310 100644
--- a/recipes-core/mkl-dnn/mkl-dnn_git.bb
+++ b/recipes-core/mkl-dnn/mkl-dnn_git.bb
@@ -7,11 +7,13 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=afa44a3d001cc203032135324f9636b7 \
 	file://src/cpu/xbyak/COPYRIGHT;md5=03532861dad9003cc2c17f14fc7a4efa"
 SECTION = "lib"
 
-inherit pkgconfig cmake
+inherit pkgconfig cmake ptest
 
 S = "${WORKDIR}/git"
 SRCREV = "027de7603662a569366e15132ac80298902b96b8"
-SRC_URI = "git://github.com/intel/mkl-dnn.git;branch=rls-v0.19"
+SRC_URI = "git://github.com/intel/mkl-dnn.git;branch=rls-v0.19 \
+        file://run-ptest \
+"
 PV = "0.19+git${SRCPV}"
 
 UPSTREAM_CHECK_GITTAGREGEX = "^v(?P<pver>(\d+(\.\d+)+))$"
@@ -24,3 +26,24 @@ EXTRA_OECMAKE += "-DMKLDNN_THREADING=OMP"
 EXTRA_OECMAKE += "-DWITH_EXAMPLE=ON"
 EXTRA_OECMAKE += "-DWITH_TEST=ON"
 EXTRA_OECMAKE += "-DARCH_OPT_FLAGS=''"
+EXTRA_OECMAKE += "-DCMAKE_SKIP_RPATH=ON"
+
+do_install_append () {
+    install -d ${D}${bindir}/mkl-dnn
+    install -d ${D}${bindir}/mkl-dnn/tests
+    install -d ${D}${bindir}/mkl-dnn/tests/benchdnn
+    install -d ${D}${bindir}/mkl-dnn/tests/benchdnn/inputs
+    install -m 0755 ${B}/tests/benchdnn/benchdnn ${D}${bindir}/mkl-dnn/tests/benchdnn
+    cp -r ${B}/tests/benchdnn/inputs/* ${D}${bindir}/mkl-dnn/tests/benchdnn/inputs
+}
+
+
+do_install_ptest () {
+    install -d ${D}${PTEST_PATH}/tests
+    install -m 0755 ${B}/tests/api-c ${D}${PTEST_PATH}/tests
+    install -m 0755 ${B}/tests/test_c_symbols-c ${D}${PTEST_PATH}/tests
+}
+
+PACKAGES =+ "${PN}-test"
+
+FILES_${PN}-test = "${bindir}/mkl-dnn/*"
-- 
2.17.1



More information about the meta-intel mailing list