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

Method getCLVersion

src/library/blas/functor/functor.cc:89–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89void clblasFunctor::getCLVersion(cl_device_id & device, int&major, int& minor)
90{
91 size_t size = 0;
92 cl_int success = 0;
93 major = 0;
94 minor = 0;
95
96 success = clGetDeviceInfo(device, CL_DEVICE_OPENCL_C_VERSION, 0, NULL, &size);
97 if (success == CL_SUCCESS)
98 {
99 char* CLVersion = NULL;
100 if (size)
101 {
102 CLVersion = new char[size];
103 if (CLVersion)
104 success = clGetDeviceInfo(device, CL_DEVICE_OPENCL_C_VERSION, size, CLVersion, NULL);
105 else
106 return;
107
108 if (success != CL_SUCCESS)
109 return;
110
111 char Major = CLVersion[9];
112 char Minor = CLVersion[11];
113 major = atoi(&Major);
114 minor = atoi(&Minor);
115
116 }
117 }
118}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected