MCPcopy Create free account
hub / github.com/clMathLibraries/clBLAS / main

Function main

src/library/common/tests/t_gens_cache.c:347–384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

345
346
347int
348main(void)
349{
350 cl_int err;
351 cl_platform_id platform;
352 cl_device_id device;
353 cl_context_properties props[] = { CL_CONTEXT_PLATFORM, 0, 0 };
354 cl_context context;
355
356 err = clGetPlatformIDs(1, &platform, NULL);
357 if (err != CL_SUCCESS) {
358 fprintf(stderr, "clGetPlatformIDs() failed with %d\n", err);
359 return 1;
360 }
361 err = clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, 1, &device, NULL);
362 if (err != CL_SUCCESS) {
363 fprintf(stderr, "clGetDeviceIDs() failed with %d\n", err);
364 return 1;
365 }
366 props[1] = (cl_context_properties)platform;
367 context = clCreateContext(props, 1, &device, NULL, NULL, &err);
368 if (err != CL_SUCCESS) {
369 fprintf(stderr, "clCreateContext() failed with %d\n", err);
370 return 1;
371 }
372
373 printf("Launch tests for kernel generators\n");
374 printf("-----------------------------------------\n");
375 if (!testGen()) {
376 printf("-----------------------------------------\n\n");
377 printf("Launch tests for kernel cache\n");
378 printf("-----------------------------------------\n");
379 testCache(context, device);
380 }
381
382 clReleaseContext(context);
383 return 0;
384}
385

Callers

nothing calls this directly

Calls 2

testGenFunction · 0.85
testCacheFunction · 0.85

Tested by

no test coverage detected