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

Method isDevSupportDoublePrecision

src/tests/BlasBase.cpp:299–345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

297}
298
299bool
300BlasBase::isDevSupportDoublePrecision(void)
301{
302 cl_int err;
303 cl_uint v;
304 size_t len;
305 char *extensions, *s;
306
307 /* Check for cl_khr_fp64 extension */
308
309 err = clGetDeviceInfo(primaryDevice_, CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE,
310 sizeof(cl_uint), &v, NULL);
311 if (err != CL_SUCCESS) {
312 return false;
313 }
314
315 if (v != 0) {
316 return true;
317 }
318
319 /* Check extensions */
320
321 err = clGetDeviceInfo(primaryDevice_, CL_DEVICE_EXTENSIONS, 0, NULL, &len);
322 if (err != CL_SUCCESS) {
323 return false;
324 }
325
326 extensions = new char[len];
327 err = clGetDeviceInfo(primaryDevice_, CL_DEVICE_EXTENSIONS, len, extensions, NULL);
328 if (err != CL_SUCCESS) {
329 delete[] extensions;
330 return false;
331 }
332
333 /* Check for cl_amd_fp64 extension */
334 s = strstr(extensions, "cl_amd_fp64"); /* strlen("cl_amd_fp64") = 11 */
335 if (s != NULL) {
336 if ((s[11] == ' ') || (s[11] == '\0')) {
337 delete[] extensions;
338 return true;
339 }
340 }
341
342 delete[] extensions;
343
344 return false;
345}
346
347void
348BlasBase::removeScratchImages(void)

Callers 15

herCorrectnessTestFunction · 0.80
swapCorrectnessTestFunction · 0.80
trmvCorrectnessTestFunction · 0.80
sprCorrectnessTestFunction · 0.80
scalCorrectnessTestFunction · 0.80
iamaxCorrectnessTestFunction · 0.80
trsvCorrectnessTestFunction · 0.80
gbmvCorrectnessTestFunction · 0.80
tpmvCorrectnessTestFunction · 0.80
syr2kCorrectnessTestFunction · 0.80
rotgCorrectnessTestFunction · 0.80
tbmvCorrectnessTestFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected