Will the speed of the kernel decrease if I allocate much more memory than I will be using?
type of memory: __global
device: GPU
btw
can i make cl_mem+=SIZEOF_ULONG*20 after allocatating cl_mem in host ?
According to Mantle programming model, GPU needs to prepare a buffer for usage in a kernel. Nothing can be said without tests, but I seriously doubt perfomance degrades significantly. A risk to run out of resources due to overallocation is a more serious concern, though.
Most implementation use lazy allocations : memory is not allocated when you call clCreateXXX, but only when you actually do something with the cl_mem (such as clWriteXXX, clMapXXX or enqueue a kernel which this cl_mem is an argument).
-
-
- Updated - - -
-
[QUOTE=tigger;37873]btw
can i make cl_mem+=SIZEOF_ULONG*20 after allocatating cl_mem in host ?[/QUOTE]
Well, that depends on what you’re trying to achieve by that … cl_mem is opaque type, and is usually the pointer to an implementation_defined struct which contains information on the allocated memory object - it is not the pointer itself (sorry, this is not CUDA…)