Example #1
0
func CLEnqueueWaitForEvents(command_queue CL_command_queue,
	num_events_in_wait_list CL_uint,
	event_wait_list []CL_event) CL_int {

	if (num_events_in_wait_list == 0 && event_wait_list != nil) ||
		(num_events_in_wait_list != 0 && event_wait_list == nil) ||
		int(num_events_in_wait_list) != len(event_wait_list) {
		return CL_INVALID_EVENT_WAIT_LIST
	}

	var c_errcode_ret C.cl_int

	if num_events_in_wait_list != 0 {
		var c_event_wait_list []C.cl_event
		c_event_wait_list = make([]C.cl_event, num_events_in_wait_list)
		for i := 0; i < int(num_events_in_wait_list); i++ {
			c_event_wait_list[i] = event_wait_list[i].cl_event
		}

		c_errcode_ret = C.clEnqueueWaitForEvents(command_queue.cl_command_queue,
			C.cl_uint(num_events_in_wait_list),
			&c_event_wait_list[0])
	} else {
		c_errcode_ret = C.clEnqueueWaitForEvents(command_queue.cl_command_queue,
			0,
			nil)
	}

	return CL_int(c_errcode_ret)
}
Example #2
0
File: package.go Project: mantyr/cl
// see https://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueWaitForEvents.html
func EnqueueWaitForEvents(cq CommandQueue, num_events uint32, event_list *Event) ErrorCode {
	return ErrorCode(C.clEnqueueWaitForEvents(cq, C.cl_uint(num_events), (*C.cl_event)(unsafe.Pointer(event_list))))
}