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

Function checkFor3DImageSupport

test_common/harness/kernelHelpers.cpp:1367–1405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1365}
1366
1367int checkFor3DImageSupport(cl_device_id device)
1368{
1369 cl_uint i;
1370 int error;
1371
1372 /* Check the device props to see if images are supported at all first */
1373 error =
1374 clGetDeviceInfo(device, CL_DEVICE_IMAGE_SUPPORT, sizeof(i), &i, NULL);
1375 test_error(error, "Unable to query device for image support");
1376 if (i == 0)
1377 {
1378 return CL_IMAGE_FORMAT_NOT_SUPPORTED;
1379 }
1380
1381 char profile[128];
1382 error = clGetDeviceInfo(device, CL_DEVICE_PROFILE, sizeof(profile), profile,
1383 NULL);
1384 test_error(error, "Unable to query device for CL_DEVICE_PROFILE");
1385 if (0 == strcmp(profile, "EMBEDDED_PROFILE"))
1386 {
1387 size_t width = -1L;
1388 size_t height = -1L;
1389 size_t depth = -1L;
1390 error = clGetDeviceInfo(device, CL_DEVICE_IMAGE3D_MAX_WIDTH,
1391 sizeof(width), &width, NULL);
1392 test_error(error, "Unable to get CL_DEVICE_IMAGE3D_MAX_WIDTH");
1393 error = clGetDeviceInfo(device, CL_DEVICE_IMAGE3D_MAX_HEIGHT,
1394 sizeof(height), &height, NULL);
1395 test_error(error, "Unable to get CL_DEVICE_IMAGE3D_MAX_HEIGHT");
1396 error = clGetDeviceInfo(device, CL_DEVICE_IMAGE3D_MAX_DEPTH,
1397 sizeof(depth), &depth, NULL);
1398 test_error(error, "Unable to get CL_DEVICE_IMAGE3D_MAX_DEPTH");
1399
1400 if (0 == (height | width | depth)) return CL_IMAGE_FORMAT_NOT_SUPPORTED;
1401 }
1402
1403 /* So our support is good */
1404 return 0;
1405}
1406
1407int checkForReadWriteImageSupport(cl_device_id device)
1408{

Callers 7

runBuildTestMethod · 0.85
test_enum_valuesFunction · 0.85
REGISTER_TESTFunction · 0.85
REGISTER_TESTFunction · 0.85
REGISTER_TESTFunction · 0.85
main.cppFile · 0.85

Calls

no outgoing calls

Tested by 5

runBuildTestMethod · 0.68
test_enum_valuesFunction · 0.68
REGISTER_TESTFunction · 0.68
REGISTER_TESTFunction · 0.68
REGISTER_TESTFunction · 0.68