当前位置: 首页>>代码示例>>Golang>>正文


Golang cl.CL_uint函数代码示例

本文整理汇总了Golang中gocl/cl.CL_uint函数的典型用法代码示例。如果您正苦于以下问题:Golang CL_uint函数的具体用法?Golang CL_uint怎么用?Golang CL_uint使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了CL_uint函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: EnqueueMap

func (this *buffer) EnqueueMap(queue CommandQueue,
	blocking_map cl.CL_bool,
	map_flags cl.CL_map_flags,
	offset cl.CL_size_t,
	cb cl.CL_size_t,
	event_wait_list []Event) (unsafe.Pointer, Event, error) {
	var errCode cl.CL_int
	var event_id cl.CL_event

	numEvents := cl.CL_uint(len(event_wait_list))
	events := make([]cl.CL_event, numEvents)
	for i := cl.CL_uint(0); i < numEvents; i++ {
		events[i] = event_wait_list[i].GetID()
	}

	if mapped_ptr := cl.CLEnqueueMapBuffer(queue.GetID(),
		this.memory_id,
		blocking_map,
		map_flags,
		offset,
		cb,
		numEvents,
		events,
		&event_id,
		&errCode); errCode != cl.CL_SUCCESS {
		return nil, nil, fmt.Errorf("EnqueueMap failure with errcode_ret %d: %s", errCode, cl.ERROR_CODES_STRINGS[-errCode])
	} else {
		return mapped_ptr, &event{event_id}, nil
	}
}
开发者ID:rainliu,项目名称:gocl,代码行数:30,代码来源:buffer.go

示例2: EnqueueWrite

func (this *buffer) EnqueueWrite(queue CommandQueue,
	blocking_write cl.CL_bool,
	offset cl.CL_size_t,
	cb cl.CL_size_t,
	ptr unsafe.Pointer,
	event_wait_list []Event) (Event, error) {
	var errCode cl.CL_int
	var event_id cl.CL_event

	numEvents := cl.CL_uint(len(event_wait_list))

	var events []cl.CL_event
	if numEvents > 0 {
		events = make([]cl.CL_event, numEvents)
		for i := cl.CL_uint(0); i < numEvents; i++ {
			events[i] = event_wait_list[i].GetID()
		}
	}

	if errCode = cl.CLEnqueueWriteBuffer(queue.GetID(),
		this.memory_id,
		blocking_write,
		offset,
		cb,
		ptr,
		numEvents,
		events,
		&event_id); errCode != cl.CL_SUCCESS {
		return nil, fmt.Errorf("EnqueueWrite failure with errcode_ret %d: %s", errCode, cl.ERROR_CODES_STRINGS[-errCode])
	} else {
		return &event{event_id}, nil
	}
}
开发者ID:rainliu,项目名称:gocl,代码行数:33,代码来源:buffer.go

示例3: EnqueueFill

func (this *buffer) EnqueueFill(queue CommandQueue,
	pattern unsafe.Pointer,
	pattern_size cl.CL_size_t,
	offset cl.CL_size_t,
	cb cl.CL_size_t,
	event_wait_list []Event) (Event, error) {
	var errCode cl.CL_int
	var event_id cl.CL_event

	numEvents := cl.CL_uint(len(event_wait_list))
	events := make([]cl.CL_event, numEvents)
	for i := cl.CL_uint(0); i < numEvents; i++ {
		events[i] = event_wait_list[i].GetID()
	}

	if errCode = cl.CLEnqueueFillBuffer(queue.GetID(),
		this.memory_id,
		pattern,
		pattern_size,
		offset,
		cb,
		numEvents,
		events,
		&event_id); errCode != cl.CL_SUCCESS {
		return nil, fmt.Errorf("EnqueueFill failure with errcode_ret %d: %s", errCode, cl.ERROR_CODES_STRINGS[-errCode])
	} else {
		return &event{event_id}, nil
	}
}
开发者ID:xfong,项目名称:gocl,代码行数:29,代码来源:buffer12.go

示例4: EnqueueCopyBuffer

func (this *command_queue) EnqueueCopyBuffer(src_buffer Buffer,
	dst_buffer Buffer,
	src_offset cl.CL_size_t,
	dst_offset cl.CL_size_t,
	cb cl.CL_size_t,
	event_wait_list []Event) (Event, error) {
	var errCode cl.CL_int
	var event_id cl.CL_event

	numEvents := cl.CL_uint(len(event_wait_list))
	events := make([]cl.CL_event, numEvents)
	for i := cl.CL_uint(0); i < numEvents; i++ {
		events[i] = event_wait_list[i].GetID()
	}

	if errCode = cl.CLEnqueueCopyBuffer(this.command_queue_id,
		src_buffer.GetID(),
		dst_buffer.GetID(),
		src_offset,
		dst_offset,
		cb,
		numEvents,
		events,
		&event_id); errCode != cl.CL_SUCCESS {
		return nil, fmt.Errorf("EnqueueCopyBuffer failure with errcode_ret %d: %s", errCode, cl.ERROR_CODES_STRINGS[-errCode])
	} else {
		return &event{event_id}, nil
	}
}
开发者ID:xfong,项目名称:gocl,代码行数:29,代码来源:queue.go

示例5: EnqueueFill

func (this *image) EnqueueFill(queue CommandQueue,
	fill_color unsafe.Pointer,
	origin [3]cl.CL_size_t,
	region [3]cl.CL_size_t,
	event_wait_list []Event) (Event, error) {
	var errCode cl.CL_int
	var event_id cl.CL_event

	numEvents := cl.CL_uint(len(event_wait_list))
	events := make([]cl.CL_event, numEvents)
	for i := cl.CL_uint(0); i < numEvents; i++ {
		events[i] = event_wait_list[i].GetID()
	}

	if errCode = cl.CLEnqueueFillImage(queue.GetID(),
		this.memory_id,
		fill_color,
		origin,
		region,
		numEvents,
		events,
		&event_id); errCode != cl.CL_SUCCESS {
		return nil, fmt.Errorf("EnqueueFill failure with errcode_ret %d: %s", errCode, cl.ERROR_CODES_STRINGS[-errCode])
	} else {
		return &event{event_id}, nil
	}
}
开发者ID:xfong,项目名称:gocl,代码行数:27,代码来源:image12.go

示例6: EnqueueNDRange

func (this *kernel) EnqueueNDRange(queue CommandQueue,
	work_dim cl.CL_uint,
	global_work_offset []cl.CL_size_t,
	global_work_size []cl.CL_size_t,
	local_work_size []cl.CL_size_t,
	event_wait_list []Event) (Event, error) {
	var errCode cl.CL_int
	var event_id cl.CL_event

	numEvents := cl.CL_uint(len(event_wait_list))

	var events []cl.CL_event

	if numEvents > 0 {
		events = make([]cl.CL_event, numEvents)
		for i := cl.CL_uint(0); i < numEvents; i++ {
			events[i] = event_wait_list[i].GetID()
		}
	}

	if errCode = cl.CLEnqueueNDRangeKernel(queue.GetID(),
		this.kernel_id,
		work_dim,
		global_work_offset,
		global_work_size,
		local_work_size,
		numEvents,
		events,
		&event_id); errCode != cl.CL_SUCCESS {
		return nil, fmt.Errorf("EnqueueNDRange failure with errcode_ret %d: %s", errCode, cl.ERROR_CODES_STRINGS[-errCode])
	} else {
		return &event{event_id}, nil
	}
}
开发者ID:rainliu,项目名称:gocl,代码行数:34,代码来源:kernel.go

示例7: WaitForEvents

func WaitForEvents(event_list []Event) error {
	numEvents := cl.CL_uint(len(event_list))
	events := make([]cl.CL_event, numEvents)
	for i := cl.CL_uint(0); i < numEvents; i++ {
		events[i] = event_list[i].GetID()
	}

	if errCode := cl.CLWaitForEvents(numEvents, events); errCode != cl.CL_SUCCESS {
		return fmt.Errorf("WaitForEvents failure with errcode_ret %d: %s", errCode, cl.ERROR_CODES_STRINGS[-errCode])
	} else {
		return nil
	}
}
开发者ID:xfong,项目名称:gocl,代码行数:13,代码来源:event.go

示例8: EnqueueMarkerWithWaitList

func (this *command_queue) EnqueueMarkerWithWaitList(event_wait_list []Event) (Event, error) {
	var event_id cl.CL_event

	numEvents := cl.CL_uint(len(event_wait_list))
	events := make([]cl.CL_event, numEvents)
	for i := cl.CL_uint(0); i < numEvents; i++ {
		events[i] = event_wait_list[i].GetID()
	}

	if errCode := cl.CLEnqueueMarkerWithWaitList(this.command_queue_id, numEvents, events, &event_id); errCode != cl.CL_SUCCESS {
		return nil, fmt.Errorf("EnqueueMarkerWithWaitList failure with errcode_ret %d: %s", errCode, cl.ERROR_CODES_STRINGS[-errCode])
	} else {
		return &event{event_id}, nil
	}
}
开发者ID:xfong,项目名称:gocl,代码行数:15,代码来源:queue12.go

示例9: EnqueueUnmap

func (this *memory) EnqueueUnmap(queue CommandQueue, mapped_ptr unsafe.Pointer, event_wait_list []Event) (Event, error) {
	var event_id cl.CL_event

	numEvents := cl.CL_uint(len(event_wait_list))
	events := make([]cl.CL_event, numEvents)
	for i := cl.CL_uint(0); i < numEvents; i++ {
		events[i] = event_wait_list[i].GetID()
	}

	if errCode := cl.CLEnqueueUnmapMemObject(queue.GetID(), this.memory_id, mapped_ptr, numEvents, events, &event_id); errCode != cl.CL_SUCCESS {
		return nil, fmt.Errorf("EnqueueMarkerWithWaitList failure with errcode_ret %d: %s", errCode, cl.ERROR_CODES_STRINGS[-errCode])
	} else {
		return &event{event_id}, nil
	}
}
开发者ID:xfong,项目名称:gocl,代码行数:15,代码来源:memory.go

示例10: CreateProgramWithBinary

func (this *context) CreateProgramWithBinary(devices []Device,
	lengths []cl.CL_size_t,
	binaries [][]byte,
	binary_status []cl.CL_int) (Program, error) {
	var errCode cl.CL_int

	numDevices := cl.CL_uint(len(devices))
	deviceIds := make([]cl.CL_device_id, numDevices)
	for i := cl.CL_uint(0); i < numDevices; i++ {
		deviceIds[i] = devices[i].GetID()
	}

	if program_id := cl.CLCreateProgramWithBinary(this.context_id, numDevices, deviceIds, lengths, binaries, binary_status, &errCode); errCode != cl.CL_SUCCESS {
		return nil, fmt.Errorf("CreateProgramWithBinary failure with errcode_ret %d: %s", errCode, cl.ERROR_CODES_STRINGS[-errCode])
	} else {
		return &program{program_id}, nil
	}
}
开发者ID:xfong,项目名称:gocl,代码行数:18,代码来源:context.go

示例11: CreateContext

func CreateContext(properties []cl.CL_context_properties,
	devices []Device,
	pfn_notify cl.CL_ctx_notify,
	user_data unsafe.Pointer) (Context, error) {
	var numDevices cl.CL_uint
	var deviceIds []cl.CL_device_id
	var errCode cl.CL_int

	numDevices = cl.CL_uint(len(devices))
	deviceIds = make([]cl.CL_device_id, numDevices)
	for i := cl.CL_uint(0); i < numDevices; i++ {
		deviceIds[i] = devices[i].GetID()
	}

	/* Create the context */
	if context_id := cl.CLCreateContext(properties, numDevices, deviceIds, pfn_notify, user_data, &errCode); errCode != cl.CL_SUCCESS {
		return nil, fmt.Errorf("CreateContext failure with errcode_ret %d: %s", errCode, cl.ERROR_CODES_STRINGS[-errCode])
	} else {
		return &context{context_id}, nil
	}
}
开发者ID:xfong,项目名称:gocl,代码行数:21,代码来源:context.go

示例12: EnqueueTask

func (this *kernel) EnqueueTask(queue CommandQueue,
	event_wait_list []Event) (Event, error) {
	var errCode cl.CL_int
	var event_id cl.CL_event

	numEvents := cl.CL_uint(len(event_wait_list))
	events := make([]cl.CL_event, numEvents)
	for i := cl.CL_uint(0); i < numEvents; i++ {
		events[i] = event_wait_list[i].GetID()
	}

	if errCode = cl.CLEnqueueTask(queue.GetID(),
		this.kernel_id,
		numEvents,
		events,
		&event_id); errCode != cl.CL_SUCCESS {
		return nil, fmt.Errorf("EnqueueTask failure with errcode_ret %d: %s", errCode, cl.ERROR_CODES_STRINGS[-errCode])
	} else {
		return &event{event_id}, nil
	}
}
开发者ID:xfong,项目名称:gocl,代码行数:21,代码来源:kernel1x.go

示例13: EnqueueMigrateMemObjects

func (this *command_queue) EnqueueMigrateMemObjects(mem_objects []Memory, flags cl.CL_mem_migration_flags, event_wait_list []Event) (Event, error) {
	var event_id cl.CL_event

	numEvents := cl.CL_uint(len(event_wait_list))
	events := make([]cl.CL_event, numEvents)
	for i := cl.CL_uint(0); i < numEvents; i++ {
		events[i] = event_wait_list[i].GetID()
	}

	numMemorys := cl.CL_uint(len(mem_objects))
	memorys := make([]cl.CL_mem, numMemorys)
	for i := cl.CL_uint(0); i < numEvents; i++ {
		memorys[i] = mem_objects[i].GetID()
	}

	if errCode := cl.CLEnqueueMigrateMemObjects(this.command_queue_id, numMemorys, memorys, flags, numEvents, events, &event_id); errCode != cl.CL_SUCCESS {
		return nil, fmt.Errorf("EnqueueMigrateMemObjects failure with errcode_ret %d: %s", errCode, cl.ERROR_CODES_STRINGS[-errCode])
	} else {
		return &event{event_id}, nil
	}
}
开发者ID:xfong,项目名称:gocl,代码行数:21,代码来源:queue12.go

示例14: EnqueueReadRect

func (this *buffer) EnqueueReadRect(queue CommandQueue,
	blocking_read cl.CL_bool,
	buffer_origin [3]cl.CL_size_t,
	host_origin [3]cl.CL_size_t,
	region [3]cl.CL_size_t,
	buffer_row_pitch cl.CL_size_t,
	buffer_slice_pitch cl.CL_size_t,
	host_row_pitch cl.CL_size_t,
	host_slice_pitch cl.CL_size_t,
	ptr unsafe.Pointer,
	event_wait_list []Event) (Event, error) {
	var errCode cl.CL_int
	var event_id cl.CL_event

	numEvents := cl.CL_uint(len(event_wait_list))
	events := make([]cl.CL_event, numEvents)
	for i := cl.CL_uint(0); i < numEvents; i++ {
		events[i] = event_wait_list[i].GetID()
	}

	if errCode = cl.CLEnqueueReadBufferRect(queue.GetID(),
		this.memory_id,
		blocking_read,
		buffer_origin,
		host_origin,
		region,
		buffer_row_pitch,
		buffer_slice_pitch,
		host_row_pitch,
		host_slice_pitch,
		ptr,
		numEvents,
		events,
		&event_id); errCode != cl.CL_SUCCESS {
		return nil, fmt.Errorf("EnqueueReadRect failure with errcode_ret %d: %s", errCode, cl.ERROR_CODES_STRINGS[-errCode])
	} else {
		return &event{event_id}, nil
	}
}
开发者ID:rainliu,项目名称:gocl,代码行数:39,代码来源:buffer.go

示例15: Compile

func (this *program) Compile(devices []Device,
	options []byte,
	input_headers []Program,
	header_include_names [][]byte,
	pfn_notify cl.CL_prg_notify,
	user_data unsafe.Pointer) error {

	numDevices := cl.CL_uint(len(devices))
	deviceIds := make([]cl.CL_device_id, numDevices)
	for i := cl.CL_uint(0); i < numDevices; i++ {
		deviceIds[i] = devices[i].GetID()
	}

	numInputHeaders := cl.CL_uint(len(input_headers))
	inputHeaders := make([]cl.CL_program, numInputHeaders)
	for i := cl.CL_uint(0); i < numInputHeaders; i++ {
		inputHeaders[i] = input_headers[i].GetID()
	}

	if errCode := cl.CLCompileProgram(this.program_id, numDevices, deviceIds, options, numInputHeaders, inputHeaders, header_include_names, pfn_notify, user_data); errCode != cl.CL_SUCCESS {
		return fmt.Errorf("Compile failure with errcode_ret %d: %s", errCode, cl.ERROR_CODES_STRINGS[-errCode])
	}
	return nil
}
开发者ID:xfong,项目名称:gocl,代码行数:24,代码来源:program12.go


注:本文中的gocl/cl.CL_uint函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。