Reputation: 21
I execute the OpenCL program on an NDRange with a work-group size of 16*16 and work-global size of 1024*1024. The application is matrix multiplication. When the two input matrix size are both little, it works well. But when the size of input matrix becomes large, for example, larger than 20000*20000, it reports error "CL_MEM_OBJECT_ALLOCATION_FAILURE" in the function of enqueuendrangekernrl.
I am puzzled. I am not familiar with memory allocation. What's the reason?
Upvotes: 0
Views: 788
Reputation: 9886
With clGetDeviceInfo, you can query the device global memory size with CL_DEVICE_GLOBAL_MEM_SIZE, and the maximum size you can alloc in a single memory object with CL_DEVICE_MAX_MEM_ALLOC_SIZE. Three matrices of 20000*20000*sizeof(float) = 1.6 GB probably exceed these limits.
Upvotes: 2