| 6373 | } |
| 6374 | |
| 6375 | cl_int enqueueNativeKernel( |
| 6376 | void (CL_CALLBACK *userFptr)(void *), |
| 6377 | std::pair<void*, ::size_t> args, |
| 6378 | const VECTOR_CLASS<Memory>* mem_objects = NULL, |
| 6379 | const VECTOR_CLASS<const void*>* mem_locs = NULL, |
| 6380 | const VECTOR_CLASS<Event>* events = NULL, |
| 6381 | Event* event = NULL) const |
| 6382 | { |
| 6383 | cl_mem * mems = (mem_objects != NULL && mem_objects->size() > 0) |
| 6384 | ? (cl_mem*) alloca(mem_objects->size() * sizeof(cl_mem)) |
| 6385 | : NULL; |
| 6386 | |
| 6387 | if (mems != NULL) { |
| 6388 | for (unsigned int i = 0; i < mem_objects->size(); i++) { |
| 6389 | mems[i] = ((*mem_objects)[i])(); |
| 6390 | } |
| 6391 | } |
| 6392 | |
| 6393 | cl_event tmp; |
| 6394 | cl_int err = detail::errHandler( |
| 6395 | ::clEnqueueNativeKernel( |
| 6396 | object_, userFptr, args.first, args.second, |
| 6397 | (mem_objects != NULL) ? (cl_uint) mem_objects->size() : 0, |
| 6398 | mems, |
| 6399 | (mem_locs != NULL && mem_locs->size() > 0) ? (const void **) &mem_locs->front() : NULL, |
| 6400 | (events != NULL) ? (cl_uint) events->size() : 0, |
| 6401 | (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, |
| 6402 | (event != NULL) ? &tmp : NULL), |
| 6403 | __ENQUEUE_NATIVE_KERNEL); |
| 6404 | |
| 6405 | if (event != NULL && err == CL_SUCCESS) |
| 6406 | *event = tmp; |
| 6407 | |
| 6408 | return err; |
| 6409 | } |
| 6410 | |
| 6411 | /** |
| 6412 | * Deprecated APIs for 1.2 |
nothing calls this directly
no test coverage detected