mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
New subgroups - full changes set (#1074)
* Extended subgroups - extended types types * Extended subgroups - non uniform vote tests * Extended subgroups - non uniform arithmetic tests * Extended subgroups - ballot tests * Extended subgroups - clustered reduce tests * Extended subgroups - shuffle tests * Extended subgroups - formating issues * Extended subgroups - review fixes * Extended subgroups - review fixes Fixed: removed additional brakes, kernel_sstr * Extended subgroups - fix macos build error * Extended subgroups - review fixes Fixed: mac os build error * Extended subgroups - data type verification example * Extended subgroups - error unification * Extended subgroups - fix header years * Extended subgroups - use is_half_nan * Extended subgroups - compare half as float * Review fixes mostly for ballot functions. - Modify kernels for better handling active/inactive workitems - Modify gen/chk functions for handling non uniform workgroup sizes - Introduce new variables naming convention - minor fixes * Extended subgroups - simplification data generation for ballot lsb/msb functions * Extended subgroups - minor fixes * Extended subgroups - move common code to function * Extended subgroups - formatting errors fix * Extended subgroups - fix build error * Extended subgroups - sub_group_elect more sophisticated Define mask which is 4bytes pattern where bit 1 means work item is active. If workitem in subgroup matches pattern then run sub_group_elect() * Extended subgroups - fix Ubuntu build error * Extended subgroups - voting function review fixes * adjust all function for using masks * remove calculate templates * merge code to one common template * check results only in active workitems * normalize values on host side * minor fixes * Extended subgroups - fix typos * Set of fixes and improvements after review * define WorkGroupParams to stop extended parameters list in function * better workitems mask handing (WorkGroupParams) * narrow values of data input generation to avoid overflows (arithmetic func) * implement work item masks for arithmetic functions * enable half type testing for reduction/scan/broadcast * minor fixes * Extended subgroups - fix Linux issues * Extended subgroups - fix sub_group_local_id data type * Extended subgroups - use vector instead of array. * Extended subgroups - change names to subgroup * Extended subgroups - uncomment code, fix build * Extended subgroups - build fix, use cl_half_from_float func * Extended subgroups - remove is_half_nan * Extended subgroups - do no use undef min/max * Extended subgroups - use parenthesis, fix formatting
This commit is contained in:
committed by
GitHub
parent
c5e4ca6c91
commit
71bef8563e
@@ -46,7 +46,7 @@ static const char *ifp_source =
|
||||
"#define INST_COUNT 0x3\n"
|
||||
"\n"
|
||||
"__kernel void\n"
|
||||
"test_ifp(const __global int *in, __global int2 *xy, __global int *out)\n"
|
||||
"test_ifp(const __global int *in, __global int4 *xy, __global int *out)\n"
|
||||
"{\n"
|
||||
" __local atomic_int loc[NUM_LOC];\n"
|
||||
"\n"
|
||||
@@ -225,10 +225,15 @@ void run_insts(cl_int *x, cl_int *p, int n)
|
||||
|
||||
struct IFP
|
||||
{
|
||||
static void gen(cl_int *x, cl_int *t, cl_int *, int ns, int nw, int ng)
|
||||
static void gen(cl_int *x, cl_int *t, cl_int *,
|
||||
const WorkGroupParams &test_params)
|
||||
{
|
||||
int k;
|
||||
int nw = test_params.local_workgroup_size;
|
||||
int ns = test_params.subgroup_size;
|
||||
int ng = test_params.global_workgroup_size;
|
||||
int nj = (nw + ns - 1) / ns;
|
||||
ng = ng / nw;
|
||||
|
||||
// We need at least 2 sub groups per group for this test
|
||||
if (nj == 1) return;
|
||||
@@ -240,11 +245,15 @@ struct IFP
|
||||
}
|
||||
}
|
||||
|
||||
static int chk(cl_int *x, cl_int *y, cl_int *t, cl_int *, cl_int *, int ns,
|
||||
int nw, int ng)
|
||||
static int chk(cl_int *x, cl_int *y, cl_int *t, cl_int *, cl_int *,
|
||||
const WorkGroupParams &test_params)
|
||||
{
|
||||
int i, k;
|
||||
int nw = test_params.local_workgroup_size;
|
||||
int ns = test_params.subgroup_size;
|
||||
int ng = test_params.global_workgroup_size;
|
||||
int nj = (nw + ns - 1) / ns;
|
||||
ng = ng / nw;
|
||||
|
||||
// We need at least 2 sub groups per group for this tes
|
||||
if (nj == 1) return 0;
|
||||
@@ -275,14 +284,17 @@ struct IFP
|
||||
int test_ifp(cl_device_id device, cl_context context, cl_command_queue queue,
|
||||
int num_elements, bool useCoreSubgroups)
|
||||
{
|
||||
int error;
|
||||
int error = TEST_PASS;
|
||||
|
||||
// Global/local work group sizes
|
||||
// Adjust these individually below if desired/needed
|
||||
#define G 2000
|
||||
#define L 200
|
||||
error = test<cl_int, IFP, G, L>::run(device, context, queue, num_elements,
|
||||
"test_ifp", ifp_source, NUM_LOC + 1,
|
||||
useCoreSubgroups);
|
||||
constexpr size_t global_work_size = 2000;
|
||||
constexpr size_t local_work_size = 200;
|
||||
WorkGroupParams test_params(global_work_size, local_work_size);
|
||||
test_params.use_core_subgroups = useCoreSubgroups;
|
||||
test_params.dynsc = NUM_LOC + 1;
|
||||
error = test<cl_int, IFP>::run(device, context, queue, num_elements,
|
||||
"test_ifp", ifp_source, test_params);
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user