From: Andreas Beckmann Date: Wed, 24 Nov 2021 09:46:50 +0000 (+0100) Subject: [PATCH 136/144] skip subdevice tests on devices with only 1 compute unit X-Git-Tag: archive/raspbian/1.8-3+rpi1^2~18 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=8c4741e6baf581f25caeaa6074fa644f738b7f93;p=pocl.git [PATCH 136/144] skip subdevice tests on devices with only 1 compute unit do not let them fail Gbp-Pq: Name 0136-skip-subdevice-tests-on-devices-with-only-1-compute-.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 1c8a2ba..85418cd 100644 --- a/examples/EinsteinToolkit/EinsteinToolkit.c +++ b/examples/EinsteinToolkit/EinsteinToolkit.c @@ -528,6 +528,18 @@ 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 b620d85..dc198bd 100644 --- a/tests/runtime/CMakeLists.txt +++ b/tests/runtime/CMakeLists.txt @@ -96,7 +96,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") @@ -136,6 +136,7 @@ set_tests_properties( "runtime/clGetDeviceInfo" "runtime/clEnqueueNativeKernel" LABELS "internal;runtime") set_tests_properties( + "runtime/clCreateSubDevices" "runtime/test_buffer_migration" "runtime/test_buffer_ping_pong" "runtime/test_cl_pocl_content_size" diff --git a/tests/runtime/test_clCreateSubDevices.c b/tests/runtime/test_clCreateSubDevices.c index fa5922e..01c2aa4 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,