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

Function imageMaxDimension

src/tests/performance/BlasBase-perf.cpp:28–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26namespace clMath {
27
28static size_t
29imageMaxDimension(cl_context context, int widthHeight)
30{
31 cl_int err;
32 cl_device_id devices[2];
33 size_t i, retSize;
34 size_t rc = (size_t)-1;
35 cl_device_info par;
36
37 par = (widthHeight) ? CL_DEVICE_IMAGE2D_MAX_HEIGHT :
38 CL_DEVICE_IMAGE2D_MAX_WIDTH;
39
40 err = clGetContextInfo(context, CL_CONTEXT_DEVICES,
41 sizeof(devices), devices, &retSize);
42 if (err == CL_SUCCESS) {
43 size_t s;
44
45 retSize /= sizeof(cl_device_id);
46 for (i = 0; (i < retSize) && (err == CL_SUCCESS); i++) {
47 err = clGetDeviceInfo(devices[i], par, sizeof(s), &s, NULL);
48 if (err == CL_SUCCESS) {
49 rc = std::min(rc, s);
50 }
51 }
52 }
53
54 if (err != CL_SUCCESS) {
55 rc = 0;
56 }
57
58 return rc;
59}
60
61static size_t
62imageMaxWidth(cl_context context)

Callers 2

imageMaxWidthFunction · 0.70
imageMaxHeightFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected