Skip to content
This repository was archived by the owner on Jan 28, 2024. It is now read-only.

Commit 84d696d

Browse files
committed
Add EnqueueTask function
1 parent fb83ec2 commit 84d696d

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

deprecated.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,27 @@ func CreateSampler(context Context, normalizedCoords bool, addressingMode Sample
4141
}
4242
return Sampler(*((*uintptr)(unsafe.Pointer(&sampler)))), nil
4343
}
44+
45+
// EnqueueTask enqueues a command to execute a kernel, using a single work-item, on a device.
46+
//
47+
// EnqueueTask() is equivalent to calling EnqueueNDRangeKernel() with one WorkDimension that has
48+
// GlobalOffset = 0, GlobalSize = 1, and LocalSize = 1.
49+
//
50+
// Deprecated: 1.2; Use EnqueueNDRangeKernel() instead.
51+
// See also: https://registry.khronos.org/OpenCL/sdk/2.2/docs/man/html/clEnqueueTask.html
52+
func EnqueueTask(commandQueue CommandQueue, kernel Kernel, waitList []Event, event *Event) error {
53+
var rawWaitList unsafe.Pointer
54+
if len(waitList) > 0 {
55+
rawWaitList = unsafe.Pointer(&waitList[0])
56+
}
57+
status := C.clEnqueueTask(
58+
commandQueue.handle(),
59+
kernel.handle(),
60+
C.cl_uint(len(waitList)),
61+
(*C.cl_event)(rawWaitList),
62+
(*C.cl_event)(unsafe.Pointer(event)))
63+
if status != C.CL_SUCCESS {
64+
return StatusError(status)
65+
}
66+
return nil
67+
}

0 commit comments

Comments
 (0)