| 65 | } |
| 66 | |
| 67 | cl_int |
| 68 | BlasBase::getPlatforms(cl_platform_id **platforms, cl_int *error) |
| 69 | { |
| 70 | cl_int err; |
| 71 | cl_uint nrPlatforms; |
| 72 | |
| 73 | //platforms = NULL; |
| 74 | |
| 75 | if (error != NULL) { |
| 76 | *error = CL_SUCCESS; |
| 77 | } |
| 78 | |
| 79 | err = clGetPlatformIDs(0, NULL, &nrPlatforms); |
| 80 | if (err != CL_SUCCESS) { |
| 81 | if (error != NULL) { |
| 82 | *error = err; |
| 83 | } |
| 84 | return 0; |
| 85 | } |
| 86 | if (nrPlatforms == 0) { |
| 87 | return 0; |
| 88 | } |
| 89 | |
| 90 | *platforms = new cl_platform_id[nrPlatforms]; |
| 91 | err = clGetPlatformIDs(nrPlatforms, *platforms, NULL); |
| 92 | if (err != CL_SUCCESS) { |
| 93 | if (error != NULL) { |
| 94 | *error = err; |
| 95 | } |
| 96 | delete[] platforms; |
| 97 | return 0; |
| 98 | } |
| 99 | return nrPlatforms; |
| 100 | } |
| 101 | |
| 102 | cl_device_id |
| 103 | BlasBase::getDevice(cl_device_type type, const char* name, |
nothing calls this directly
no outgoing calls
no test coverage detected