Use old-style sampler creation in basic suite and remove duplicate compatibility tests (#510)

As agreed in the WG calls, the query tests are sufficient to cover
both old-style and new-style sampler and command queue creation
entrypoints.

Use old-style entrypoints in all tests that don't require 2.x
features to get compatibility with 1.x implementations.
This makes it possible to remove duplicate compatibility tests.

Contributes to #494.

Signed-off-by: Kévin Petit <kpet@free.fr>
This commit is contained in:
Kévin Petit
2019-12-11 10:36:45 +00:00
committed by GitHub
parent 7127b2a05f
commit 1c04050b5b
26 changed files with 32 additions and 3212 deletions

View File

@@ -286,13 +286,8 @@ test_image_multipass_integer_coord(cl_device_id device, cl_context context, cl_c
clReleaseProgram(program[1]);
}
cl_sampler_properties properties[] = {
CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE,
CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_CLAMP_TO_EDGE,
CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST,
0 };
cl_sampler sampler = clCreateSamplerWithProperties(context, properties, &err);
test_error(err, "clCreateSamplerWithProperties failed");
cl_sampler sampler = clCreateSampler(context, CL_FALSE, CL_ADDRESS_CLAMP_TO_EDGE, CL_FILTER_NEAREST, &err);
test_error(err, "clCreateSampler failed");
{
size_t threads[3] = {0, 0, 0};
@@ -532,13 +527,8 @@ test_image_multipass_float_coord(cl_device_id device, cl_context context, cl_com
clReleaseProgram(program[1]);
}
cl_sampler_properties properties[] = {
CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE,
CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_CLAMP_TO_EDGE,
CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST,
0 };
cl_sampler sampler = clCreateSamplerWithProperties(context, properties, &err);
test_error(err, "clCreateSamplerWithProperties failed");
cl_sampler sampler = clCreateSampler(context, CL_FALSE, CL_ADDRESS_CLAMP_TO_EDGE, CL_FILTER_NEAREST, &err);
test_error(err, "clCreateSampler failed");
{
size_t threads[3] = {0, 0, 0};

View File

@@ -239,13 +239,8 @@ int test_image_param(cl_device_id device, cl_context context, cl_command_queue q
test_error( error, "Unable to create testing kernel" );
// Also create a sampler to use for all the runs
cl_sampler_properties properties[] = {
CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE,
CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_CLAMP_TO_EDGE,
CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST,
0 };
clSamplerWrapper sampler = clCreateSamplerWithProperties(context, properties, &error);
test_error(error, "clCreateSamplerWithProperties failed");
clSamplerWrapper sampler = clCreateSampler(context, CL_FALSE, CL_ADDRESS_CLAMP_TO_EDGE, CL_FILTER_NEAREST, &error );
test_error( error, "clCreateSampler failed" );
// Set up the arguments for each and queue
for( i = 0, idx = 0; i < numSizes; i++ )

View File

@@ -129,13 +129,8 @@ test_image_r8(cl_device_id device, cl_context context, cl_command_queue queue, i
return -1;
}
cl_sampler_properties properties[] = {
CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE,
CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_CLAMP_TO_EDGE,
CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST,
0 };
cl_sampler sampler = clCreateSamplerWithProperties(context, properties, &err);
test_error(err, "clCreateSamplerWithProperties failed");
cl_sampler sampler = clCreateSampler(context, CL_FALSE, CL_ADDRESS_CLAMP_TO_EDGE, CL_FILTER_NEAREST, &err);
test_error(err, "clCreateSampler failed");
err = clSetKernelArg(kernel, 0, sizeof streams[0], &streams[0]);
err |= clSetKernelArg(kernel, 1, sizeof streams[1], &streams[1]);

View File

@@ -117,13 +117,8 @@ test_imagedim_pow2(cl_device_id device, cl_context context, cl_command_queue que
max_mem_size = (cl_ulong)SIZE_MAX;
}
cl_sampler_properties properties[] = {
CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE,
CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_CLAMP_TO_EDGE,
CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST,
0 };
cl_sampler sampler = clCreateSamplerWithProperties(context, properties, &err);
test_error(err, "clCreateSamplerWithProperties failed");
cl_sampler sampler = clCreateSampler(context, CL_FALSE, CL_ADDRESS_CLAMP_TO_EDGE, CL_FILTER_NEAREST, &err);
test_error(err, "clCreateSampler failed");
max_img_width = (int)max_image2d_width;
max_img_height = (int)max_image2d_height;
@@ -154,9 +149,9 @@ test_imagedim_pow2(cl_device_id device, cl_context context, cl_command_queue que
log_info("Adjusted maximum image size to test is %d x %d, which is a max mem size of %gMB.\n",
max_img_width, max_img_height, (max_img_width*max_img_height*4)/(1024.0*1024.0));
d = init_genrand( gRandomSeed );
input_ptr = generate_8888_image(max_img_width, max_img_height, d);
output_ptr = (unsigned char*)malloc(sizeof(unsigned char) * 4 * max_img_width * max_img_height);
d = init_genrand( gRandomSeed );
input_ptr = generate_8888_image(max_img_width, max_img_height, d);
output_ptr = (unsigned char*)malloc(sizeof(unsigned char) * 4 * max_img_width * max_img_height);
// test power of 2 width, height starting at 1 to 4K
for (i=1,i2=0; i<=max_img_height; i<<=1,i2++)
@@ -328,13 +323,8 @@ test_imagedim_non_pow2(cl_device_id device, cl_context context, cl_command_queue
log_info("Device reported max image sizes of %lu x %lu, and max mem size of %gMB.\n",
max_image2d_width, max_image2d_height, max_mem_size/(1024.0*1024.0));
cl_sampler_properties properties[] = {
CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE,
CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_CLAMP_TO_EDGE,
CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST,
0 };
cl_sampler sampler = clCreateSamplerWithProperties(context, properties, &err);
test_error(err, "clCreateSamplerWithProperties failed");
cl_sampler sampler = clCreateSampler(context, CL_FALSE, CL_ADDRESS_CLAMP_TO_EDGE, CL_FILTER_NEAREST, &err);
test_error(err, "clCreateSampler failed");
max_img_width = (int)max_image2d_width;
max_img_height = (int)max_image2d_height;

View File

@@ -150,13 +150,8 @@ test_imagenpot(cl_device_id device_id, cl_context context, cl_command_queue queu
return -1;
}
cl_sampler_properties properties[] = {
CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE,
CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_CLAMP_TO_EDGE,
CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST,
0 };
cl_sampler sampler = clCreateSamplerWithProperties(context, properties, &err);
test_error(err, "clCreateSamplerWithProperties failed");
cl_sampler sampler = clCreateSampler(context, CL_FALSE, CL_ADDRESS_CLAMP_TO_EDGE, CL_FILTER_NEAREST, &err);
test_error(err, "clCreateSampler failed");
err = clSetKernelArg(kernel, 0, sizeof streams[0], &streams[0]);
err |= clSetKernelArg(kernel, 1, sizeof streams[1], &streams[1]);

View File

@@ -181,13 +181,8 @@ test_mri_multiple(cl_device_id device, cl_context context, cl_command_queue queu
if (err)
return -1;
cl_sampler_properties properties[] = {
CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE,
CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_CLAMP_TO_EDGE,
CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST,
0 };
cl_sampler sampler = clCreateSamplerWithProperties(context, properties, &err);
test_error(err, "clCreateSamplerWithProperties failed");
cl_sampler sampler = clCreateSampler(context, CL_FALSE, CL_ADDRESS_CLAMP_TO_EDGE, CL_FILTER_NEAREST, &err);
test_error(err, "clCreateSampler failed");
for (i=0; i<4; i++)
err |= clSetKernelArg(kernel, i,sizeof streams[i], &streams[i]);

View File

@@ -147,13 +147,8 @@ int test_mri_one(cl_device_id device, cl_context context, cl_command_queue queue
if (err)
return -1;
cl_sampler_properties properties[] = {
CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE,
CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_CLAMP_TO_EDGE,
CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST,
0 };
cl_sampler sampler = clCreateSamplerWithProperties(context, properties, &err);
test_error(err, "clCreateSamplerWithProperties failed");
cl_sampler sampler = clCreateSampler(context, CL_FALSE, CL_ADDRESS_CLAMP_TO_EDGE, CL_FILTER_NEAREST, &err);
test_error(err, "clCreateSampler failed");
err = clSetKernelArg(kernel, 0, sizeof i, &i);
err |= clSetKernelArg(kernel, 1, sizeof err, &err);

View File

@@ -167,13 +167,8 @@ int test_readimage3d(cl_device_id device, cl_context context, cl_command_queue q
if (err)
return -1;
cl_sampler_properties properties[] = {
CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE,
CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_CLAMP_TO_EDGE,
CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST,
0 };
cl_sampler sampler = clCreateSamplerWithProperties(context, properties, &err);
test_error(err, "clCreateSamplerWithProperties failed");
cl_sampler sampler = clCreateSampler(context, CL_FALSE, CL_ADDRESS_CLAMP_TO_EDGE, CL_FILTER_NEAREST, &err);
test_error(err, "clCreateSampler failed");
err = clSetKernelArg(kernel[0], 0, sizeof streams[0], &streams[0]);
err |= clSetKernelArg(kernel[0], 1, sizeof streams[2], &streams[2]);

View File

@@ -114,13 +114,8 @@ int test_readimage3d_fp32(cl_device_id device, cl_context context, cl_command_qu
if (err)
return -1;
cl_sampler_properties properties[] = {
CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE,
CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_CLAMP_TO_EDGE,
CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST,
0 };
cl_sampler sampler = clCreateSamplerWithProperties(context, properties, &err);
test_error(err, "clCreateSamplerWithProperties failed");
cl_sampler sampler = clCreateSampler(context, CL_FALSE, CL_ADDRESS_CLAMP_TO_EDGE, CL_FILTER_NEAREST, &err);
test_error(err, "clCreateSampler failed");
err = clSetKernelArg(kernel, 0, sizeof streams[0], &streams[0]);
err |= clSetKernelArg(kernel, 1, sizeof streams[1], &streams[1]);

View File

@@ -113,13 +113,8 @@ int test_readimage3d_int16(cl_device_id device, cl_context context, cl_command_q
if (err)
return -1;
cl_sampler_properties properties[] = {
CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE,
CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_CLAMP_TO_EDGE,
CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST,
0 };
cl_sampler sampler = clCreateSamplerWithProperties(context, properties, &err);
test_error(err, "clCreateSamplerWithProperties failed");
cl_sampler sampler = clCreateSampler(context, CL_FALSE, CL_ADDRESS_CLAMP_TO_EDGE, CL_FILTER_NEAREST, &err);
test_error(err, "clCreateSampler failed");
err = clSetKernelArg(kernel, 0, sizeof streams[0], &streams[0]);
err |= clSetKernelArg(kernel, 1, sizeof streams[1], &streams[1]);

View File

@@ -123,13 +123,8 @@ int test_readimage_fp32(cl_device_id device, cl_context context, cl_command_queu
if (err)
return -1;
cl_sampler_properties properties[] = {
CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE,
CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_CLAMP_TO_EDGE,
CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST,
0 };
cl_sampler sampler = clCreateSamplerWithProperties(context, properties, &err);
test_error(err, "clCreateSamplerWithProperties failed");
cl_sampler sampler = clCreateSampler(context, CL_FALSE, CL_ADDRESS_CLAMP_TO_EDGE, CL_FILTER_NEAREST, &err);
test_error(err, "clCreateSampler failed");
err = clSetKernelArg(kernel, 0, sizeof streams[0], &streams[0]);
err |= clSetKernelArg(kernel, 1, sizeof streams[1], &streams[1]);

View File

@@ -122,13 +122,8 @@ int test_readimage_int16(cl_device_id device, cl_context context, cl_command_que
if (err)
return -1;
cl_sampler_properties properties[] = {
CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE,
CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_CLAMP_TO_EDGE,
CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST,
0 };
cl_sampler sampler = clCreateSamplerWithProperties(context, properties, &err);
test_error(err, "clCreateSamplerWithProperties failed");
cl_sampler sampler = clCreateSampler(context, CL_FALSE, CL_ADDRESS_CLAMP_TO_EDGE, CL_FILTER_NEAREST, &err);
test_error(err, "clCreateSampler failed");
err = clSetKernelArg(kernel, 0, sizeof streams[0], &streams[0]);
err |= clSetKernelArg(kernel, 1, sizeof streams[1], &streams[1]);