Altera_Forum
Honored Contributor
7 years agoGetting CL_OUT_OF_RESOURCES with clenqueuewritebuffer API
Hi,
I am transferring one 4k frame(3840x2160) from Host to device. My device global memory is 2GB. We are creating memory object of size 3968 * 2272. If I am using clcreatebuffer, with CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR flags, its running for all 600 iterations. dstPtr1 = clCreateBuffer(context, CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, 3968 * 2272, hostPtr1, &err); if ((CL_SUCCESS != err) || (NULL == dstPtr1)) { printf("Error in clCreateBuffer dstPtr1 %d\n", err); exit(-1); } If we are using below, then it's throwing CL_OUT_OF_RESOURCES after 230 iterations even if we release the memory. dstPtr1 = clCreateBuffer(context, CL_MEM_READ_ONLY, 3968 * 2272, NULL, &err); if ((CL_SUCCESS != err) || (NULL == dstPtr1)) { printf("Error in clCreateBuffer dstPtr1 %d\n", err); exit(-1); } err = clEnqueueWriteBuffer(commandQueue[0], dstPtr1, CL_TRUE, 0, 3968 * 2272 * sizeof(pixel), hostPtr1, 0, NULL, NULL); if (CL_SUCCESS != err) { printf("Error in clEnqueueWriteBuffer dstPtr1 %d\n", err); exit(-1); } What I am not able to understand is both the API calls does the same operation of copying the data from Host to device, but only when I use clEnqueueWriteBuffer I am getting CL_OUT_OF_RESOURCES. Is there any difference between them. Thanks in advance.