Hi.
I apologize for my English.
I have a program that runs fine when the CONTEXT I have defined a GPU.
When I define a CPU, the program freezes when it reaches the line
clReleaseMemObject (memObjects [0]);
after a while, it quits without error and without end.
Deputy of the code.
My config:
Windows 7 64b
CPU Phenom 2 710
Ati 5750
jorg 1.4 b1
Atthach part of the code.
while (!wordS.isEmpty()) {
Pointer dst = Pointer.to(dstArray);
cl_mem memObjects[] = new cl_mem[3];
// Set the arguments for the kernel
memObjects[0] = clCreateBuffer(context, CL_MEM_READ_ONLY
| CL_MEM_COPY_HOST_PTR, Sizeof.cl_float * n, wordS.get(0)
.getSrcPointerA(), null);
memObjects[1] = clCreateBuffer(context, CL_MEM_READ_ONLY
| CL_MEM_COPY_HOST_PTR, Sizeof.cl_float * n, wordS.get(0)
.getSrcPointerB(), null);
memObjects[2] = clCreateBuffer(context, CL_MEM_WRITE_ONLY,
Sizeof.cl_float * n, null, null);
// Set the arguments for the kernel
clSetKernelArg(kernel, 0, Sizeof.cl_mem, Pointer.to(memObjects[0]));
clSetKernelArg(kernel, 1, Sizeof.cl_mem, Pointer.to(memObjects[1]));
clSetKernelArg(kernel, 2, Sizeof.cl_mem, Pointer.to(memObjects[2]));
// Set the work-item dimensions
long global_work_size[] = new long[] { n };
long local_work_size[] = new long[] { 1 };
// Execute the kernel
clEnqueueNDRangeKernel(commandQueue, kernel, 1, null,
global_work_size, local_work_size, 0, null, null);
// Read the output data
clEnqueueReadBuffer(commandQueue, memObjects[2], CL_TRUE, 0, n
* Sizeof.cl_float, dst, 0, null, null);
System.out.println(wordS.get(0).getPalabra()+" "+new String(dstArray, 0, dstArray.length - 1));
wordS.remove(0);
//Release memory objects
clReleaseMemObject(memObjects[0]);
clReleaseMemObject(memObjects[1]);
clReleaseMemObject(memObjects[2]);
}