Test api fix - sampler properties is 0 in compatibility mode (#1106)

This commit is contained in:
Grzegorz Wawiorko
2021-01-15 17:31:03 +01:00
committed by GitHub
parent 03a0989998
commit 0d74b3f926

View File

@@ -231,23 +231,39 @@ int test_sampler_params(cl_device_id deviceID, cl_context context,
error, error,
"clGetSamplerInfo failed asking for CL_SAMPLER_PROPERTIES size."); "clGetSamplerInfo failed asking for CL_SAMPLER_PROPERTIES size.");
if (set_size != test_properties.size() * sizeof(cl_sampler_properties)) if (is_compatibility)
{ {
log_error("ERROR: CL_SAMPLER_PROPERTIES size is %d, expected %d.\n", if (set_size != 0)
set_size, {
test_properties.size() * sizeof(cl_sampler_properties)); log_error(
return TEST_FAIL; "ERROR: CL_SAMPLER_PROPERTIES size is %d, expected 0\n",
set_size);
return TEST_FAIL;
}
} }
else
{
if (set_size
!= test_properties.size() * sizeof(cl_sampler_properties))
{
log_error(
"ERROR: CL_SAMPLER_PROPERTIES size is %d, expected %d.\n",
set_size,
test_properties.size() * sizeof(cl_sampler_properties));
return TEST_FAIL;
}
cl_uint number_of_props = set_size / sizeof(cl_sampler_properties); cl_uint number_of_props = set_size / sizeof(cl_sampler_properties);
check_properties.resize(number_of_props); check_properties.resize(number_of_props);
error = clGetSamplerInfo(sampler, CL_SAMPLER_PROPERTIES, set_size, error = clGetSamplerInfo(sampler, CL_SAMPLER_PROPERTIES, set_size,
check_properties.data(), 0); check_properties.data(), 0);
test_error(error, test_error(
"clGetSamplerInfo failed asking for CL_SAMPLER_PROPERTIES."); error,
"clGetSamplerInfo failed asking for CL_SAMPLER_PROPERTIES.");
error = compareProperties(check_properties, test_properties); error = compareProperties(check_properties, test_properties);
test_error(error, "checkProperties mismatch."); test_error(error, "checkProperties mismatch.");
}
} }
return 0; return 0;
} }