From: Andreas Beckmann Date: Sat, 26 Dec 2020 20:26:31 +0000 (+0000) Subject: skip subdevice tests on (virtual) single core CPUs X-Git-Tag: archive/raspbian/1.6-3+rpi1~8 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7c3988c8b5529132c6ba724f44b16b97a1461ca6;p=pocl.git skip subdevice tests on (virtual) single core CPUs Gbp-Pq: Name skip-subdevice-tests-on-single-core-cpus.patch --- diff --git a/examples/EinsteinToolkit/CMakeLists.txt b/examples/EinsteinToolkit/CMakeLists.txt index 704a02e..139d1c6 100644 --- a/examples/EinsteinToolkit/CMakeLists.txt +++ b/examples/EinsteinToolkit/CMakeLists.txt @@ -54,5 +54,6 @@ if(NOT MIPS) COST 15.0 LABELS "EinsteinToolkit" ENVIRONMENT "POCL_AFFINITY=1" + SKIP_RETURN_CODE 77 DEPENDS "pocl_version_check") endif() diff --git a/examples/EinsteinToolkit/EinsteinToolkit.c b/examples/EinsteinToolkit/EinsteinToolkit.c index eab4431..b9a5d62 100644 --- a/examples/EinsteinToolkit/EinsteinToolkit.c +++ b/examples/EinsteinToolkit/EinsteinToolkit.c @@ -528,6 +528,16 @@ void setup(const char* program_source1, const char* program_source2) if (use_subdev) { + { + cl_uint max_cus; + int err = clGetDeviceInfo (main_device_id, CL_DEVICE_MAX_COMPUTE_UNITS, + sizeof(max_cus), &max_cus, NULL); + assert (err == CL_SUCCESS); + if (max_cus < 2) { + fprintf(stderr, "Insufficient compute units for subdevice creation\n"); + exit(77); + } + } const cl_device_partition_property props[] = { CL_DEVICE_PARTITION_EQUALLY, 2, 0 }; cl_device_id subdevs[128]; diff --git a/tests/runtime/CMakeLists.txt b/tests/runtime/CMakeLists.txt index 0a0a7c9..eb2fa17 100644 --- a/tests/runtime/CMakeLists.txt +++ b/tests/runtime/CMakeLists.txt @@ -84,7 +84,7 @@ add_test_pocl(NAME "runtime/clGetSupportedImageFormats" COMMAND "test_clGetSuppo add_test_pocl(NAME "runtime/clCreateKernelsInProgram" COMMAND "test_clCreateKernelsInProgram") -add_test_pocl(NAME "runtime/clCreateSubDevices" COMMAND "test_clCreateSubDevices") +add_test(NAME "runtime/clCreateSubDevices" COMMAND "test_clCreateSubDevices") add_test_pocl(NAME "runtime/test_event_free" COMMAND "test_event_free") @@ -114,6 +114,10 @@ set_tests_properties("runtime/clGetSupportedImageFormats" PROPERTIES ENVIRONMENT "POCL_DEVICES=pthread\ pthread") +set_tests_properties("runtime/clCreateSubDevices" + PROPERTIES + SKIP_RETURN_CODE 77) + if(NOT ENABLE_ANYSAN) set_tests_properties("runtime/clCreateKernelsInProgram" PROPERTIES diff --git a/tests/runtime/test_clCreateSubDevices.c b/tests/runtime/test_clCreateSubDevices.c index 91a4d26..d896997 100644 --- a/tests/runtime/test_clCreateSubDevices.c +++ b/tests/runtime/test_clCreateSubDevices.c @@ -140,7 +140,7 @@ int main(int argc, char **argv) { printf("This test requires a cl device with at least 2 compute units" " (a dual-core or better CPU)\n"); - return 1; + return 77; } err = clGetDeviceInfo(rootdev, CL_DEVICE_PARTITION_MAX_SUB_DEVICES,