struct _starpu_mp_node *_starpu_mic_src_get_actual_thread_mp_node() { struct _starpu_worker *actual_worker = _starpu_get_local_worker_key(); STARPU_ASSERT(actual_worker); int devid = actual_worker->devid; STARPU_ASSERT(devid >= 0 && devid < STARPU_MAXMICDEVS); return mic_nodes[devid]; }
void _starpu_wait_on_sched_event(void) { struct starpu_worker_s *worker = _starpu_get_local_worker_key(); PTHREAD_MUTEX_LOCK(worker->sched_mutex); _starpu_handle_all_pending_node_data_requests(worker->memory_node); if (_starpu_machine_is_running()) { #ifndef STARPU_NON_BLOCKING_DRIVERS pthread_cond_wait(worker->sched_cond, worker->sched_mutex); #endif } PTHREAD_MUTEX_UNLOCK(worker->sched_mutex); }
void starpu_opencl_get_current_context(cl_context *context) { struct _starpu_worker *worker = _starpu_get_local_worker_key(); STARPU_ASSERT(context); *context = contexts[worker->devid]; }
void starpu_opencl_get_current_queue(cl_command_queue *queue) { struct _starpu_worker *worker = _starpu_get_local_worker_key(); STARPU_ASSERT(queue); *queue = queues[worker->devid]; }