Example #1
0
func CLWaitForEvents(num_events CL_uint,
	event_list []CL_event) CL_int {

	if num_events == 0 || event_list == nil || int(num_events) != len(event_list) {
		return CL_INVALID_VALUE
	}

	var c_event_list []C.cl_event
	c_event_list = make([]C.cl_event, len(event_list))
	for i := 0; i < len(event_list); i++ {
		c_event_list[i] = event_list[i].cl_event
	}

	return CL_int(C.clWaitForEvents(C.cl_uint(num_events), &c_event_list[0]))
}
Example #2
0
File: package.go Project: mantyr/cl
// see https://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clWaitForEvents.html
func WaitForEvents(numEvents uint32, events *Event) ErrorCode {
	return ErrorCode(C.clWaitForEvents(C.cl_uint(numEvents), (*C.cl_event)(unsafe.Pointer(events))))
}
Example #3
0
// Waits on the host thread for commands identified by event objects in
// events to complete. A command is considered complete if its execution
// status is CL_COMPLETE or a negative value. The events specified in
// event_list act as synchronization points.
//
// If the cl_khr_gl_event extension is enabled, event objects can also be
// used to reflect the status of an OpenGL sync object. The sync object
// in turn refers to a fence command executing in an OpenGL command
// stream. This provides another method of coordinating sharing of buffers
// and images between OpenGL and OpenCL.
func WaitForEvents(events []*Event) error {
	return toError(C.clWaitForEvents(C.cl_uint(len(events)), eventListPtr(events)))
}