Set up each test variation to exit with an error if it cant detect a GPU or if it expect not GPU and detects one.
@@ -38,6 +38,10 @@ test-nvidia-gpu:
stage: test
script:
- clinfo
+ - PLATFORMS=$(clinfo | grep "Number of platforms" | sed "s/Number of platforms[[:space:]]*\([0-9]*\)[^0-9]*/\1/g")
+ - if [ $PLATFORMS == "0" ]; then
+ exit -1;
+ fi
- mvn $MAVEN_CLI_OPTS test
tags:
- opencl
@@ -47,6 +51,9 @@ test-nvidia-cpu:
stage: test
script:
- clinfo
+ - if [ $PLATFORMS != "0" ]; then
+ exit -1;
+ fi
- mvn $MAVEN_CLI_OPTS test
tags:
- compute
@@ -56,6 +63,9 @@ test-amdgpu-cpu:
stage: test
script:
- clinfo
+ - if [ $PLATFORMS != "0" ]; then
+ exit -1;
+ fi
- mvn $MAVEN_CLI_OPTS test
tags:
- compute
@@ -65,6 +75,9 @@ test-pocl-gpu:
stage: test
script:
- clinfo
+ - if [ $PLATFORMS == "0" ]; then
+ exit -1;
+ fi
- mvn $MAVEN_CLI_OPTS test
tags:
- opencl
@@ -74,6 +87,9 @@ test-amdgpu-cpu:
stage: test
script:
- clinfo
+ - if [ $PLATFORMS != "0" ]; then
+ exit -1;
+ fi
- mvn $MAVEN_CLI_OPTS test
tags:
- compute
