Example #1
0
func CLSetEventCallback(event CL_event,
	command_exec_callback_type CL_int,
	pfn_notify CL_evt_notify,
	user_data unsafe.Pointer) CL_int {

	if pfn_notify != nil {
		evt_notify[event.cl_event] = pfn_notify

		return CL_int(C.CLSetEventCallback(event.cl_event,
			C.cl_int(command_exec_callback_type),
			user_data))
	} else {
		return CL_int(C.clSetEventCallback(event.cl_event,
			C.cl_int(command_exec_callback_type),
			nil,
			nil))
	}
}
Example #2
0
File: gl_cl.go Project: xfong/tmpCL
func (ctx *Context) CreateFromGlBuffer(flag MemFlag, GlBufferObject GLUint) (*MemObject, error) {
	var err C.int
	memobj := C.clCreateFromGLBuffer(ctx.clContext, flag.GlBufferCreateFlag(), (C.cl_GLuint)(GlBufferObject), &err)

	if toError(C.cl_int(err)) != nil {
		return nil, toError(GlErrorCodeToCl(int(err)))
	}
	GlBufferObj := &MemObject{clMem: memobj, size: 0}
	bufSize, sizeErr := GlBufferObj.GetSize()
	if sizeErr != nil {
		fmt.Printf("Unable to get buffer size in CreateFromGlBuffer \n")
		return nil, sizeErr
	}
	GlBufferObj.size = bufSize
	return GlBufferObj, nil
}
Example #3
0
// Sets the execution status of a user event object.
//
// `status` specifies the new execution status to be set and
// can be CL_COMPLETE or a negative integer value to indicate
// an error. A negative integer value causes all enqueued commands
// that wait on this user event to be terminated. clSetUserEventStatus
// can only be called once to change the execution status of event.
func (e *Event) SetUserEventStatus(status int) error {
	return toError(C.clSetUserEventStatus(e.clEvent, C.cl_int(status)))
}
Example #4
0
func CLSetUserEventStatus(event CL_event,
	execution_status CL_int) CL_int {
	return CL_int(C.clSetUserEventStatus(event.cl_event, C.cl_int(execution_status)))
}