[SCM] ViennaCL packaging branch, master, updated. debian/1.1.2-6-20-g412b4cd
Michael Wild
themiwi at users.sourceforge.net
Sun Feb 26 17:46:45 UTC 2012
The following commit has been merged in the master branch:
commit 412b4cd2aa04a1b4224d09a38b577dc173e65d89
Author: Michael Wild <themiwi at users.sourceforge.net>
Date: Sun Feb 26 18:29:02 2012 +0100
Run tests conditional on compute capability
Signed-off-by: Michael Wild <themiwi at users.sourceforge.net>
diff --git a/debian/rules b/debian/rules
index bd1b031..e484361 100755
--- a/debian/rules
+++ b/debian/rules
@@ -15,6 +15,13 @@ override_dh_auto_configure:
rm -rf CL
dh_auto_configure
+override_dh_auto_test: $(BUILDDIR)/test_compute_capability
+ if $(BUILDDIR)/test_compute_capability; then \
+ dh_auto_test; \
+ else \
+ echo '== SKIPPING TESTS BECAUSE NO OPENCL CAPABILITY FOUND ==' >&2; \
+ fi
+
override_dh_auto_install:
pdftotext -f 54 -l 58 -nopgbrk -r 150 \
-x 130 -y 160 -W 980 -H 1440 -enc ASCII7 \
@@ -31,6 +38,9 @@ override_dh_auto_install:
done
dh_auto_install
+$(BUILDDIR)/test_compute_capability: debian/test_compute_capability.c
+ gcc -o $@ -lOpenCL $^
+
get-orig-source:
TMPDIR=`mktemp -d`; \
echo TMPDIR = $$TMPDIR; \
diff --git a/debian/test_compute_capability.c b/debian/test_compute_capability.c
new file mode 100644
index 0000000..b1082de
--- /dev/null
+++ b/debian/test_compute_capability.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+#include <CL/opencl.h>
+
+int main()
+{
+ cl_platform_id pform_id;
+ if (clGetPlatformIDs(1, &pform_id, NULL) == CL_SUCCESS)
+ {
+ cl_int ndevices;
+ if (clGetDeviceIDs(pform_id, CL_DEVICE_TYPE_ALL, 0, NULL, &ndevices) != CL_SUCCESS)
+ {
+ return 0;
+ }
+ }
+ return 1;
+}
--
ViennaCL packaging
More information about the debian-science-commits
mailing list