| 258 | } |
| 259 | |
| 260 | cl_mem |
| 261 | BlasBase::createEnqueueBuffer( |
| 262 | const void *data, |
| 263 | size_t matrSize, |
| 264 | size_t off, |
| 265 | cl_mem_flags mode) |
| 266 | { |
| 267 | cl_int err; |
| 268 | cl_mem buf; |
| 269 | cl_uint i; |
| 270 | |
| 271 | #ifdef DEBUG_CONTEXT |
| 272 | cl_uint refcnt; |
| 273 | printf("BLASBASE: createEnqBuff - Querying context %p\n", context_); |
| 274 | if (clGetContextInfo(context_, CL_CONTEXT_REFERENCE_COUNT, sizeof(cl_uint), &refcnt, NULL) != CL_SUCCESS) |
| 275 | { |
| 276 | printf("BLASBASE: clGetContextInfo FAILED\n"); |
| 277 | } else { |
| 278 | printf("BLASBASE: REFCNT = %u\n", refcnt); |
| 279 | } |
| 280 | #endif |
| 281 | buf = clCreateBuffer(context_, mode, matrSize + off, NULL, &err); |
| 282 | |
| 283 | if ( data != NULL ) { |
| 284 | if (err == CL_SUCCESS ) { |
| 285 | for (i = 0; i < numCommandQueues_; i++) { |
| 286 | err = clEnqueueWriteBuffer(commandQueues_[i], buf, CL_TRUE, |
| 287 | off, matrSize, data, 0, NULL, NULL); |
| 288 | if (err != CL_SUCCESS) { |
| 289 | clReleaseMemObject(buf); |
| 290 | return NULL; |
| 291 | } |
| 292 | } |
| 293 | } |
| 294 | } |
| 295 | |
| 296 | return buf; |
| 297 | } |
| 298 | |
| 299 | bool |
| 300 | BlasBase::isDevSupportDoublePrecision(void) |
no outgoing calls
no test coverage detected