//.........这里部分代码省略.........
// Associate the input and output buffers with the
// kernel
// using clSetKernelArg()
status = cl.CLSetKernelArg(kernel,
0,
cl.CL_size_t(unsafe.Sizeof(bufferA)),
unsafe.Pointer(&bufferA))
status |= cl.CLSetKernelArg(kernel,
1,
cl.CL_size_t(unsafe.Sizeof(bufferB)),
unsafe.Pointer(&bufferB))
status |= cl.CLSetKernelArg(kernel,
2,
cl.CL_size_t(unsafe.Sizeof(bufferC)),
unsafe.Pointer(&bufferC))
if status != cl.CL_SUCCESS {
println("CLSetKernelArg status!=cl.CL_SUCCESS")
return
}
//-----------------------------------------------------
// STEP 10: Configure the work-item structure
//-----------------------------------------------------
// Define an index space (global work size) of work
// items for
// execution. A workgroup size (local work size) is not
// required,
// but can be used.
var globalWorkSize [1]cl.CL_size_t
// There are 'elements' work-items
globalWorkSize[0] = elements
//-----------------------------------------------------
// STEP 11: Enqueue the kernel for execution
//-----------------------------------------------------
// Execute the kernel by using
// clEnqueueNDRangeKernel().
// 'globalWorkSize' is the 1D dimension of the
// work-items
status = cl.CLEnqueueNDRangeKernel(cmdQueue,
kernel,
1,
nil,
globalWorkSize[:],
nil,
0,
nil,
nil)
if status != cl.CL_SUCCESS {
println("CLEnqueueNDRangeKernel status!=cl.CL_SUCCESS")
return
}
//-----------------------------------------------------
// STEP 12: Read the output buffer back to the host
//-----------------------------------------------------
// Use clEnqueueReadBuffer() to read the OpenCL output
// buffer (bufferC)
// to the host output array (C)
cl.CLEnqueueReadBuffer(cmdQueue,
bufferC,
cl.CL_TRUE,
0,
datasize,
unsafe.Pointer(&C[0]),
0,
nil,
nil)
if status != cl.CL_SUCCESS {
println("CLEnqueueReadBuffer status!=cl.CL_SUCCESS")
return
}
// Verify the output
result := true
for i := cl.CL_int(0); i < cl.CL_int(elements); i++ {
if C[i] != i+i {
result = false
break
}
}
if result {
println("Output is correct\n")
} else {
println("Output is incorrect\n")
}
//-----------------------------------------------------
// STEP 13: Release OpenCL resources
//-----------------------------------------------------
// Free OpenCL resources
cl.CLReleaseKernel(kernel)
cl.CLReleaseProgram(program)
cl.CLReleaseCommandQueue(cmdQueue)
cl.CLReleaseMemObject(bufferA)
cl.CLReleaseMemObject(bufferB)
cl.CLReleaseMemObject(bufferC)
cl.CLReleaseContext(context)
}
开发者ID:xfong,项目名称:gocl,代码行数:101,代码来源:chapter2.go
示例2: main
//.........这里部分代码省略.........
f = cl.CL_int(filterWidth)
status = cl.CLSetKernelArg(kernel, 0, cl.CL_size_t(unsafe.Sizeof(d_inputImage)), unsafe.Pointer(&d_inputImage))
status |= cl.CLSetKernelArg(kernel, 1, cl.CL_size_t(unsafe.Sizeof(d_outputImage)), unsafe.Pointer(&d_outputImage))
status |= cl.CLSetKernelArg(kernel, 2, cl.CL_size_t(unsafe.Sizeof(h)), unsafe.Pointer(&h))
status |= cl.CLSetKernelArg(kernel, 3, cl.CL_size_t(unsafe.Sizeof(w)), unsafe.Pointer(&w))
status |= cl.CLSetKernelArg(kernel, 4, cl.CL_size_t(unsafe.Sizeof(d_filter)), unsafe.Pointer(&d_filter))
status |= cl.CLSetKernelArg(kernel, 5, cl.CL_size_t(unsafe.Sizeof(f)), unsafe.Pointer(&f))
status |= cl.CLSetKernelArg(kernel, 6, cl.CL_size_t(unsafe.Sizeof(sampler)), unsafe.Pointer(&sampler))
chk(status, "clSetKernelArg")
// Set the work item dimensions
var globalSize = [2]cl.CL_size_t{imageWidth, imageHeight}
status = cl.CLEnqueueNDRangeKernel(queue, kernel, 2, nil, globalSize[:], nil, 0,
nil, nil)
chk(status, "clEnqueueNDRange")
// Read the image back to the host
status = cl.CLEnqueueReadImage(queue, d_outputImage, cl.CL_TRUE, origin,
region, 0, 0, unsafe.Pointer(&outputImage[0]), 0, nil, nil)
chk(status, "clEnqueueReadImage")
// Write the output image to file
for i = 0; i < imageHeight*imageWidth; i++ {
outputpixels[i] = uint16(outputImage[i])
}
utils.Write_image_data(outputFile, outputpixels, imageWidth, imageHeight)
// Compute the reference image
for i = 0; i < imageHeight; i++ {
for j = 0; j < imageWidth; j++ {
refImage[i*imageWidth+j] = 0
}
}
// Iterate over the rows of the source image
halfFilterWidth := filterWidth / 2
var sum float32
for i = 0; i < imageHeight; i++ {
// Iterate over the columns of the source image
for j = 0; j < imageWidth; j++ {
sum = 0 // Reset sum for new source pixel
// Apply the filter to the neighborhood
for k := -halfFilterWidth; k <= halfFilterWidth; k++ {
for l := -halfFilterWidth; l <= halfFilterWidth; l++ {
if i+k >= 0 && i+k < imageHeight &&
j+l >= 0 && j+l < imageWidth {
sum += inputImage[(i+k)*imageWidth+j+l] *
filter[(k+halfFilterWidth)*filterWidth+
l+halfFilterWidth]
} else {
i_k := i + k
j_l := j + l
if i+k < 0 {
i_k = 0
} else if i+k >= imageHeight {
i_k = imageHeight - 1
}
if j+l < 0 {
j_l = 0
} else if j+l >= imageWidth {
j_l = imageWidth - 1
}
sum += inputImage[(i_k)*imageWidth+j_l] *
filter[(k+halfFilterWidth)*filterWidth+
l+halfFilterWidth]
}
}
}
refImage[i*imageWidth+j] = sum
}
}
// Write the ref image to file
for i = 0; i < imageHeight*imageWidth; i++ {
outputpixels[i] = uint16(refImage[i])
}
utils.Write_image_data(refFile, outputpixels, imageWidth, imageHeight)
failed := 0
for i = 0; i < imageHeight; i++ {
for j = 0; j < imageWidth; j++ {
if math.Abs(float64(outputImage[i*imageWidth+j]-refImage[i*imageWidth+j])) > 0.01 {
//fmt.Printf("Results are INCORRECT\n");
//fmt.Printf("Pixel mismatch at <%d,%d> (%f vs. %f) %f\n", i, j,
// outputImage[i*imageWidth+j], refImage[i*imageWidth+j], inputImage[i*imageWidth+j]);
failed++
}
}
}
fmt.Printf("Mismatch Pixel number/Total pixel number = %d/%d\n", failed, imageWidth*imageHeight)
// Free OpenCL resources
cl.CLReleaseKernel(kernel)
cl.CLReleaseProgram(*program)
cl.CLReleaseCommandQueue(queue)
cl.CLReleaseMemObject(d_inputImage)
cl.CLReleaseMemObject(d_outputImage)
cl.CLReleaseMemObject(d_filter)
cl.CLReleaseSampler(sampler)
cl.CLReleaseContext(context)
}
func main() {
/* OpenCL data structures */
var device []cl.CL_device_id
var context cl.CL_context
var queue cl.CL_command_queue
var program *cl.CL_program
var kernel cl.CL_kernel
var err cl.CL_int
/* Data and buffers */
var r_coords = [4]float32{2, 1, 3, 4}
var angles = [4]float32{3 * M_PI / 8, 3 * M_PI / 4, 4 * M_PI / 3, 11 * M_PI / 6}
var x_coords, y_coords [4]float32
var r_coords_buffer, angles_buffer,
x_coords_buffer, y_coords_buffer cl.CL_mem
/* Create a device and context */
device = utils.Create_device()
context = cl.CLCreateContext(nil, 1, device[:], nil, nil, &err)
if err < 0 {
println("Couldn't create a context")
return
}
/* Create a kernel */
program = utils.Build_program(context, device[:], PROGRAM_FILE, nil)
kernel = cl.CLCreateKernel(*program, KERNEL_FUNC, &err)
if err < 0 {
println("Couldn't create a kernel")
return
}
/* Create a write-only buffer to hold the output data */
r_coords_buffer = cl.CLCreateBuffer(context, cl.CL_MEM_READ_ONLY|cl.CL_MEM_COPY_HOST_PTR,
cl.CL_size_t(unsafe.Sizeof(r_coords)), unsafe.Pointer(&r_coords[0]), &err)
if err < 0 {
println("Couldn't create a buffer")
return
}
angles_buffer = cl.CLCreateBuffer(context, cl.CL_MEM_READ_ONLY|cl.CL_MEM_COPY_HOST_PTR,
cl.CL_size_t(unsafe.Sizeof(angles)), unsafe.Pointer(&angles[0]), &err)
x_coords_buffer = cl.CLCreateBuffer(context, cl.CL_MEM_READ_WRITE,
cl.CL_size_t(unsafe.Sizeof(x_coords)), nil, &err)
y_coords_buffer = cl.CLCreateBuffer(context, cl.CL_MEM_READ_WRITE,
cl.CL_size_t(unsafe.Sizeof(y_coords)), nil, &err)
/* Create kernel argument */
err = cl.CLSetKernelArg(kernel, 0, cl.CL_size_t(unsafe.Sizeof(r_coords_buffer)), unsafe.Pointer(&r_coords_buffer))
if err < 0 {
println("Couldn't set a kernel argument")
return
}
cl.CLSetKernelArg(kernel, 1, cl.CL_size_t(unsafe.Sizeof(angles_buffer)), unsafe.Pointer(&angles_buffer))
cl.CLSetKernelArg(kernel, 2, cl.CL_size_t(unsafe.Sizeof(x_coords_buffer)), unsafe.Pointer(&x_coords_buffer))
cl.CLSetKernelArg(kernel, 3, cl.CL_size_t(unsafe.Sizeof(y_coords_buffer)), unsafe.Pointer(&y_coords_buffer))
/* Create a command queue */
queue = cl.CLCreateCommandQueue(context, device[0], 0, &err)
if err < 0 {
println("Couldn't create a command queue")
return
}
/* Enqueue kernel */
err = cl.CLEnqueueTask(queue, kernel, 0, nil, nil)
if err < 0 {
println("Couldn't enqueue the kernel")
return
}
/* Read and print the result */
err = cl.CLEnqueueReadBuffer(queue, x_coords_buffer, cl.CL_TRUE, 0,
cl.CL_size_t(unsafe.Sizeof(x_coords)), unsafe.Pointer(&x_coords), 0, nil, nil)
if err < 0 {
println("Couldn't read the buffer")
return
}
cl.CLEnqueueReadBuffer(queue, y_coords_buffer, cl.CL_TRUE, 0,
cl.CL_size_t(unsafe.Sizeof(y_coords)), unsafe.Pointer(&y_coords), 0, nil, nil)
/* Display the results */
for i := 0; i < 4; i++ {
fmt.Printf("(%6.3f, %6.3f)\n", x_coords[i], y_coords[i])
}
/* Deallocate resources */
cl.CLReleaseMemObject(r_coords_buffer)
cl.CLReleaseMemObject(angles_buffer)
cl.CLReleaseMemObject(x_coords_buffer)
cl.CLReleaseMemObject(y_coords_buffer)
cl.CLReleaseKernel(kernel)
cl.CLReleaseCommandQueue(queue)
cl.CLReleaseProgram(*program)
cl.CLReleaseContext(context)
}
开发者ID:xfong,项目名称:gocl,代码行数:96,代码来源:polar_rect.go
示例7: main
func main() {
/* OpenCL data structures */
var device []cl.CL_device_id
var context cl.CL_context
var queue cl.CL_command_queue
var program *cl.CL_program
var kernel cl.CL_kernel
var err cl.CL_int
var offset, global_size, local_size [1]cl.CL_size_t
/* Data and events */
var data [2]cl.CL_int
var data_buffer cl.CL_mem
/* Create a device and context */
device = utils.Create_device()
context = cl.CLCreateContext(nil, 1, device[:], nil, nil, &err)
if err < 0 {
println("Couldn't create a context")
return
}
/* Build the program and create a kernel */
program = utils.Build_program(context, device[:], PROGRAM_FILE, nil)
kernel = cl.CLCreateKernel(*program, KERNEL_FUNC, &err)
if err < 0 {
println("Couldn't create a kernel")
return
}
/* Create a buffer to hold data */
data_buffer = cl.CLCreateBuffer(context, cl.CL_MEM_WRITE_ONLY,
cl.CL_size_t(unsafe.Sizeof(data[0]))*2, nil, &err)
if err < 0 {
println("Couldn't create a buffer")
return
}
/* Create kernel argument */
err = cl.CLSetKernelArg(kernel, 0, cl.CL_size_t(unsafe.Sizeof(data_buffer)), unsafe.Pointer(&data_buffer))
if err < 0 {
println("Couldn't set a kernel argument")
return
}
/* Create a command queue */
queue = cl.CLCreateCommandQueue(context, device[0], 0, &err)
if err < 0 {
println("Couldn't create a command queue")
return
}
/* Enqueue kernel */
offset[0] = 0
global_size[0] = 8
local_size[0] = 4
err = cl.CLEnqueueNDRangeKernel(queue, kernel, 1, offset[:], global_size[:], local_size[:], 0, nil, nil)
if err < 0 {
println("Couldn't enqueue the kernel")
return
}
/* Read the buffer */
err = cl.CLEnqueueReadBuffer(queue, data_buffer, cl.CL_TRUE, 0,
cl.CL_size_t(unsafe.Sizeof(data[0]))*2, unsafe.Pointer(&data[0]), 0, nil, nil)
if err < 0 {
println("Couldn't read the buffer")
return
}
fmt.Printf("Increment: %d\n", data[0])
fmt.Printf("Atomic increment: %d\n", data[1])
/* Deallocate resources */
cl.CLReleaseMemObject(data_buffer)
cl.CLReleaseKernel(kernel)
cl.CLReleaseCommandQueue(queue)
cl.CLReleaseProgram(*program)
cl.CLReleaseContext(context)
}
开发者ID:xfong,项目名称:gocl,代码行数:82,代码来源:atomic.go
示例8: main
//.........这里部分代码省略.........
defer cl.CLReleaseProgram(program)
// Build (compile) the program for the devices with
// clBuildProgram()
options := "-cl-std=CL2.0"
status = cl.CLBuildProgram(program,
numDevices,
devices,
[]byte(options),
nil,
nil)
if status != cl.CL_SUCCESS {
var program_log interface{}
var log_size cl.CL_size_t
/* Find size of log and print to std output */
cl.CLGetProgramBuildInfo(program, devices[0], cl.CL_PROGRAM_BUILD_LOG,
0, nil, &log_size)
cl.CLGetProgramBuildInfo(program, devices[0], cl.CL_PROGRAM_BUILD_LOG,
log_size, &program_log, nil)
fmt.Printf("%s\n", program_log)
return
}
//utils.CHECK_STATUS(status, cl.CL_SUCCESS, "CLBuildProgram")
//-----------------------------------------------------
// STEP 7: Create the kernel
//-----------------------------------------------------
var kernel cl.CL_kernel
// Use clCreateKernel() to create a kernel
kernel = cl.CLCreateKernel(program, []byte("bst_kernel"), &status)
utils.CHECK_STATUS(status, cl.CL_SUCCESS, "CLCreateKernel")
defer cl.CLReleaseKernel(kernel)
//-----------------------------------------------------
// STEP 8: Set the kernel arguments
//-----------------------------------------------------
// Associate the input and output buffers with the
// kernel
// using clSetKernelArg()
// Set appropriate arguments to the kernel
status = cl.CLSetKernelArgSVMPointer(kernel,
0,
svmTreeBuf)
utils.CHECK_STATUS(status, cl.CL_SUCCESS, "clSetKernelArgSVMPointer(svmTreeBuf)")
status = cl.CLSetKernelArgSVMPointer(kernel,
1,
svmSearchBuf)
utils.CHECK_STATUS(status, cl.CL_SUCCESS, "clSetKernelArgSVMPointer(svmSearchBuf)")
//-----------------------------------------------------
// STEP 9: Configure the work-item structure
//-----------------------------------------------------
// Define an index space (global work size) of work
// items for
// execution. A workgroup size (local work size) is not
// required,
// but can be used.
var localWorkSize [1]cl.CL_size_t
var kernelWorkGroupSize interface{}
status = cl.CLGetKernelWorkGroupInfo(kernel,
devices[0],
cl.CL_KERNEL_WORK_GROUP_SIZE,
cl.CL_size_t(unsafe.Sizeof(localWorkSize[0])),
开发者ID:xfong,项目名称:gocl,代码行数:67,代码来源:bst.go
示例9: main
//.........这里部分代码省略.........
/* Initialize arrays */
for i := 0; i < 100; i++ {
data_one[i] = 1.0 * float32(i)
data_two[i] = -1.0 * float32(i)
result_array[i] = 0.0
}
/* Create a device and context */
device = utils.Create_device()
context = cl.CLCreateContext(nil, 1, device[:], nil, nil, &err)
if err < 0 {
println("Couldn't create a context")
return
}
/* Build the program and create the kernel */
program = utils.Build_program(context, device[:], PROGRAM_FILE, nil)
kernel = cl.CLCreateKernel(*program, []byte(KERNEL_FUNC), &err)
if err < 0 {
println("Couldn't create a kernel")
return
}
/* Create buffers */
buffer_one = cl.CLCreateBuffer(context, cl.CL_MEM_READ_WRITE|
cl.CL_MEM_COPY_HOST_PTR, cl.CL_size_t(unsafe.Sizeof(data_one)), unsafe.Pointer(&data_one[0]), &err)
if err < 0 {
println("Couldn't create buffer object 1")
return
}
buffer_two = cl.CLCreateBuffer(context, cl.CL_MEM_READ_WRITE|
cl.CL_MEM_COPY_HOST_PTR, cl.CL_size_t(unsafe.Sizeof(data_two)), unsafe.Pointer(&data_two), &err)
if err < 0 {
println("Couldn't create buffer object 2")
return
}
/* Set buffers as arguments to the kernel */
err = cl.CLSetKernelArg(kernel, 0, cl.CL_size_t(unsafe.Sizeof(buffer_one)), unsafe.Pointer(&buffer_one))
err |= cl.CLSetKernelArg(kernel, 1, cl.CL_size_t(unsafe.Sizeof(buffer_two)), unsafe.Pointer(&buffer_two))
if err < 0 {
println("Couldn't set the buffer as the kernel argument")
return
}
/* Create a command queue */
queue = cl.CLCreateCommandQueue(context, device[0], 0, &err)
if err < 0 {
println("Couldn't create a command queue")
return
}
/* Enqueue kernel */
err = cl.CLEnqueueTask(queue, kernel, 0, nil, nil)
if err < 0 {
println("Couldn't enqueue the kernel")
return
}
/* Enqueue command to copy buffer one to buffer two */
err = cl.CLEnqueueCopyBuffer(queue, buffer_one, buffer_two, 0, 0,
cl.CL_size_t(unsafe.Sizeof(data_one)), 0, nil, nil)
if err < 0 {
println("Couldn't perform the buffer copy")
return
}
/* Enqueue command to map buffer two to host memory */
mapped_memory = cl.CLEnqueueMapBuffer(queue, buffer_two, cl.CL_TRUE,
cl.CL_MAP_READ, 0, cl.CL_size_t(unsafe.Sizeof(data_two)), 0, nil, nil, &err)
if err < 0 {
println("Couldn't map the buffer to host memory")
return
}
/* Transfer memory and unmap the buffer */
C.memcpy(unsafe.Pointer(&result_array[0]), mapped_memory, C.size_t(unsafe.Sizeof(data_two)))
err = cl.CLEnqueueUnmapMemObject(queue, buffer_two, mapped_memory,
0, nil, nil)
if err < 0 {
println("Couldn't unmap the buffer")
return
}
/* Display updated buffer */
for i := 0; i < 10; i++ {
for j := 0; j < 10; j++ {
fmt.Printf("%6.1f", result_array[j+i*10])
}
fmt.Printf("\n")
}
/* Deallocate resources */
cl.CLReleaseMemObject(buffer_one)
cl.CLReleaseMemObject(buffer_two)
cl.CLReleaseKernel(kernel)
cl.CLReleaseCommandQueue(queue)
cl.CLReleaseProgram(*program)
cl.CLReleaseContext(context)
}
开发者ID:xfong,项目名称:gocl,代码行数:101,代码来源:map_copy.go
示例10: main
//.........这里部分代码省略.........
/* Extension data */
var sizeofuint cl.CL_uint
var addr_data interface{}
var ext_data interface{}
fp64_ext := "cl_khr_fp64"
var ext_size cl.CL_size_t
var options []byte
/* Create a device and context */
device = utils.Create_device()
context = cl.CLCreateContext(nil, 1, device[:], nil, nil, &err)
if err < 0 {
println("Couldn't create a context")
return
}
/* Obtain the device data */
if cl.CLGetDeviceInfo(device[0], cl.CL_DEVICE_ADDRESS_BITS,
cl.CL_size_t(unsafe.Sizeof(sizeofuint)), &addr_data, nil) < 0 {
println("Couldn't read extension data")
return
}
fmt.Printf("Address width: %v\n", addr_data.(cl.CL_uint))
/* Define "FP_64" option if doubles are supported */
cl.CLGetDeviceInfo(device[0], cl.CL_DEVICE_EXTENSIONS,
0, nil, &ext_size)
// ext_data = (char*)malloc(ext_size + 1);
// ext_data[ext_size] = '\0';
cl.CLGetDeviceInfo(device[0], cl.CL_DEVICE_EXTENSIONS,
ext_size, &ext_data, nil)
if strings.Contains(ext_data.(string), fp64_ext) {
fmt.Printf("The %s extension is supported.\n", fp64_ext)
options = []byte("-DFP_64 ")
} else {
fmt.Printf("The %s extension is not supported. %s\n", fp64_ext, ext_data.(string))
}
/* Build the program and create the kernel */
program = utils.Build_program(context, device[:], PROGRAM_FILE, options)
kernel = cl.CLCreateKernel(*program, KERNEL_FUNC, &err)
if err < 0 {
println("Couldn't create a kernel")
return
}
/* Create CL buffers to hold input and output data */
a_buffer = cl.CLCreateBuffer(context, cl.CL_MEM_READ_ONLY|
cl.CL_MEM_COPY_HOST_PTR, cl.CL_size_t(unsafe.Sizeof(a)), unsafe.Pointer(&a), &err)
if err < 0 {
println("Couldn't create a memory object")
return
}
b_buffer = cl.CLCreateBuffer(context, cl.CL_MEM_READ_ONLY|
cl.CL_MEM_COPY_HOST_PTR, cl.CL_size_t(unsafe.Sizeof(b)), unsafe.Pointer(&b), nil)
output_buffer = cl.CLCreateBuffer(context, cl.CL_MEM_WRITE_ONLY,
cl.CL_size_t(unsafe.Sizeof(b)), nil, nil)
/* Create kernel arguments */
err = cl.CLSetKernelArg(kernel, 0, cl.CL_size_t(unsafe.Sizeof(a_buffer)), unsafe.Pointer(&a_buffer))
if err < 0 {
println("Couldn't set a kernel argument")
return
}
cl.CLSetKernelArg(kernel, 1, cl.CL_size_t(unsafe.Sizeof(b_buffer)), unsafe.Pointer(&b_buffer))
cl.CLSetKernelArg(kernel, 2, cl.CL_size_t(unsafe.Sizeof(output_buffer)), unsafe.Pointer(&output_buffer))
/* Create a command queue */
queue = cl.CLCreateCommandQueue(context, device[0], 0, &err)
if err < 0 {
println("Couldn't create a command queue")
return
}
/* Enqueue kernel */
err = cl.CLEnqueueTask(queue, kernel, 0, nil, nil)
if err < 0 {
println("Couldn't enqueue the kernel")
return
}
/* Read and print the result */
err = cl.CLEnqueueReadBuffer(queue, output_buffer, cl.CL_TRUE, 0,
cl.CL_size_t(unsafe.Sizeof(result)), unsafe.Pointer(&result), 0, nil, nil)
if err < 0 {
println("Couldn't read the output buffer")
return
}
fmt.Printf("The kernel result is %f\n", result)
/* Deallocate resources */
cl.CLReleaseMemObject(a_buffer)
cl.CLReleaseMemObject(b_buffer)
cl.CLReleaseMemObject(output_buffer)
cl.CLReleaseKernel(kernel)
cl.CLReleaseCommandQueue(queue)
cl.CLReleaseProgram(*program)
cl.CLReleaseContext(context)
}
请发表评论