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

Method getPlatforms

src/tests/BlasBase.cpp:67–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67cl_int
68BlasBase::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
102cl_device_id
103BlasBase::getDevice(cl_device_type type, const char* name,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected