Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion OpenCL/src/main/scala/com/thoughtworks/compute/OpenCL.scala
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,20 @@ object OpenCL {
def monadicClose = UnitContinuation.delay {
OpenCL.checkErrorCode(clReleaseProgram(handle))
}

def kernelNames(): Seq[String] = {
val stack = stackPush()
try {
val sizeBuffer = stack.mallocPointer(1)
checkErrorCode(clGetProgramInfo(this.handle, CL_PROGRAM_KERNEL_NAMES, null: ByteBuffer, sizeBuffer))
val nameBuffer = stack.malloc(sizeBuffer.get(0).toInt)
checkErrorCode(clGetProgramInfo(this.handle, CL_PROGRAM_KERNEL_NAMES, nameBuffer, null: PointerBuffer))
memUTF8(nameBuffer).split(';')
} finally {
stack.close()
}
}

}

object Program {
Expand Down Expand Up @@ -1216,7 +1230,7 @@ trait OpenCL extends MonadicCloseable[UnitContinuation] with ImplicitsSingleton
val cl20Properties = (properties.view.flatMap { case (key, value) => Seq(key, value) } ++ Seq(0L)).toArray
val a = Array(0)
val commandQueue =
clCreateCommandQueueWithProperties(platformId.handle, deviceId.handle, cl20Properties, a)
clCreateCommandQueueWithProperties(context, deviceId.handle, cl20Properties, a)
checkErrorCode(a(0))
commandQueue
} else {
Expand Down