--- Quote Start ---
You might have a memory leak somewhere and you are running out of host or device memory. Pay careful attention to all OpenCL-related buffers, events, etc. and make sure everything that is not reused, is freed.
--- Quote End ---
That's what i strange about my code. For example:
Kernel 1 code
//Create and write buffer
buffer_input_matrix = clCreateBuffer(context, CL_MEM_READ_ONLY, datasize, NULL, &status);
/* Write data from the input arrays to the buffers */
status = clEnqueueWriteBuffer(cmd_queue, buffer_input_matrix, CL_TRUE, 0, datasize, input_matrix_dis, 0, NULL, &int_str_input_matrix_enqueue);
runKernel(kernel1,buffer_input_matrix..);
Then i did not write the buffer_input_matrix anymore and reuse them for kernel2, how can i free the memory on the device? Releasing the memory object? Imagine i only want to copy the device but don't stored in there or keep them on the memory device.
edit1: i got this error when creating the buffer: -5 (CL_OUT_OF_RESOURCES)