| 165 | CL_FILTER_LINEAR }; |
| 166 | |
| 167 | int test_sampler_params(cl_device_id device, cl_context context, |
| 168 | bool is_compatibility, size_t norm_coord_num, |
| 169 | size_t addr_mod_num, size_t filt_mod_num) |
| 170 | { |
| 171 | cl_uint refCount; |
| 172 | size_t size; |
| 173 | int error; |
| 174 | |
| 175 | clSamplerWrapper sampler; |
| 176 | cl_sampler_properties properties[] = { |
| 177 | CL_SAMPLER_NORMALIZED_COORDS, |
| 178 | normalized_coord_values[norm_coord_num], |
| 179 | CL_SAMPLER_ADDRESSING_MODE, |
| 180 | addressing_mode_values[addr_mod_num], |
| 181 | CL_SAMPLER_FILTER_MODE, |
| 182 | filter_mode_values[filt_mod_num], |
| 183 | 0 |
| 184 | }; |
| 185 | |
| 186 | if (is_compatibility) |
| 187 | { |
| 188 | sampler = |
| 189 | clCreateSampler(context, normalized_coord_values[norm_coord_num], |
| 190 | addressing_mode_values[addr_mod_num], |
| 191 | filter_mode_values[filt_mod_num], &error); |
| 192 | test_error(error, "Unable to create sampler to test with"); |
| 193 | } |
| 194 | else |
| 195 | { |
| 196 | sampler = clCreateSamplerWithProperties(context, properties, &error); |
| 197 | test_error(error, "Unable to create sampler to test with"); |
| 198 | } |
| 199 | |
| 200 | error = clGetSamplerInfo(sampler, CL_SAMPLER_REFERENCE_COUNT, |
| 201 | sizeof(refCount), &refCount, &size); |
| 202 | test_error(error, "Unable to get sampler ref count"); |
| 203 | test_assert_error(size == sizeof(refCount), |
| 204 | "Returned size of sampler refcount does not validate!\n"); |
| 205 | |
| 206 | error = sampler_param_test(sampler, CL_SAMPLER_CONTEXT, context, "context"); |
| 207 | test_error(error, "param checking failed"); |
| 208 | |
| 209 | error = sampler_param_test(sampler, CL_SAMPLER_ADDRESSING_MODE, |
| 210 | addressing_mode_values[addr_mod_num], |
| 211 | "addressing mode"); |
| 212 | test_error(error, "param checking failed"); |
| 213 | |
| 214 | error = sampler_param_test(sampler, CL_SAMPLER_FILTER_MODE, |
| 215 | filter_mode_values[filt_mod_num], "filter mode"); |
| 216 | test_error(error, "param checking failed"); |
| 217 | |
| 218 | error = sampler_param_test(sampler, CL_SAMPLER_NORMALIZED_COORDS, |
| 219 | normalized_coord_values[norm_coord_num], |
| 220 | "normalized coords"); |
| 221 | test_error(error, "param checking failed"); |
| 222 | |
| 223 | Version version = get_device_cl_version(device); |
| 224 | if (version >= Version(3, 0)) |
no test coverage detected