| 297 | } |
| 298 | |
| 299 | bool |
| 300 | BlasBase::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 | |
| 347 | void |
| 348 | BlasBase::removeScratchImages(void) |
no outgoing calls
no test coverage detected