MCPcopy Create free account
hub / github.com/KhronosGroup/OpenCL-CTS / doTest

Function doTest

test_conformance/select/test_select.cpp:314–480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312 snprintf(testname, sizeof(testname), "select_%s_%s", stypename, ctypename );
313 log_info("Building %s(%s, %s, %s)\n", testname, stypename, stypename, ctypename);
314 break;
315 default:
316 log_error( "Unkown vector type. Aborting...\n" );
317 exit(-1);
318 break;
319 }
320
321 /*
322 int j;
323 for( j = 0; j < sizeof( source ) / sizeof( source[0] ); j++ )
324 log_info( "%s", source[j] );
325 */
326
327 // create program
328 cl_program program;
329 const char **psrc = vec_len == 3 ? sourceV3 : source;
330 size_t src_size = vec_len == 3 ? ARRAY_SIZE(sourceV3) : ARRAY_SIZE(source);
331
332 if (create_single_kernel_helper(context, &program, kernel_ptr, src_size,
333 psrc, testname))
334 {
335 log_error("Failed to build program (%d)\n", err);
336 return NULL;
337 }
338
339 return program;
340}
341
342#define VECTOR_SIZE_COUNT 6
343
344static int doTest(cl_command_queue queue, cl_context context, Type stype, Type cmptype, cl_device_id device)
345{
346 int err = CL_SUCCESS;
347 MTdataHolder d(gRandomSeed);
348 const size_t element_count[VECTOR_SIZE_COUNT] = { 1, 2, 3, 4, 8, 16 };
349 clMemWrapper src1, src2, cmp, dest;
350
351 const size_t block_elements = BUFFER_SIZE / type_size[stype];
352
353 // It is more efficient to create the tests all at once since we
354 // use the same test data on each of the vector sizes
355 clProgramWrapper programs[VECTOR_SIZE_COUNT];
356 clKernelWrapper kernels[VECTOR_SIZE_COUNT];
357
358 if (stype == kdouble && !is_extension_available(device, "cl_khr_fp64"))
359 {
360 log_info("Skipping double because cl_khr_fp64 extension is not supported.\n");
361 return 0;
362 }
363
364 if (stype == khalf && !is_extension_available(device, "cl_khr_fp16"))
365 {
366 log_info(
367 "Skipping half because cl_khr_fp16 extension is not supported.\n");
368 return 0;
369 }
370
371 if (gIsEmbedded)

Callers 1

REGISTER_TESTFunction · 0.70

Calls 4

is_extension_availableFunction · 0.85
makeSelectProgramFunction · 0.85
initSrcBufferFunction · 0.85
initCmpBufferFunction · 0.85

Tested by

no test coverage detected