mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-23 15:39:03 +00:00
Check for non-uniform work-group support (#1383)
Only run sub-group tests with non-uniform work-groups on OpenCL 3.0 and later if it is supported by the device.
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
#include "procs.h"
|
#include "procs.h"
|
||||||
#include "harness/conversions.h"
|
#include "harness/conversions.h"
|
||||||
#include "harness/typeWrappers.h"
|
#include "harness/typeWrappers.h"
|
||||||
|
#include <CL/cl.h>
|
||||||
|
|
||||||
struct get_test_data
|
struct get_test_data
|
||||||
{
|
{
|
||||||
@@ -251,8 +252,21 @@ int test_work_item_functions(cl_device_id device, cl_context context,
|
|||||||
|
|
||||||
global = local * 5;
|
global = local * 5;
|
||||||
|
|
||||||
// Make sure we have a flexible range
|
// Non-uniform work-groups are an optional feature from 3.0 onward.
|
||||||
global += 3 * local / 4;
|
cl_bool device_supports_non_uniform_wg = CL_TRUE;
|
||||||
|
if (get_device_cl_version(device) >= Version(3, 0))
|
||||||
|
{
|
||||||
|
error = clGetDeviceInfo(
|
||||||
|
device, CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT, sizeof(cl_bool),
|
||||||
|
&device_supports_non_uniform_wg, nullptr);
|
||||||
|
test_error(error, "clGetDeviceInfo failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (device_supports_non_uniform_wg)
|
||||||
|
{
|
||||||
|
// Make sure we have a flexible range
|
||||||
|
global += 3 * local / 4;
|
||||||
|
}
|
||||||
|
|
||||||
// Collect the data
|
// Collect the data
|
||||||
memset((void *)&result, 0xf0, sizeof(result));
|
memset((void *)&result, 0xf0, sizeof(result));
|
||||||
@@ -327,4 +341,4 @@ int test_work_item_functions_ext(cl_device_id device, cl_context context,
|
|||||||
|
|
||||||
return test_work_item_functions(device, context, queue, num_elements,
|
return test_work_item_functions(device, context, queue, num_elements,
|
||||||
false);
|
false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user