I came across the Python library libgpuarray and was reading about it but could not really understand what a GPU array is and why do we need it? What is the difference between a normal array and GPU array?

Please excuse the noobness of the question.

  • $\begingroup$ Not sure this is on-topic here... $\endgroup$ – Yuval Filmus Jan 11 '16 at 4:34
  • $\begingroup$ @YuvalFilmus I'd say this is almost one where on-topicness depends on what the answer is. If there's a computer science answer (e.g., something about how GPUs work means that it's better to have arrays laid out in some special way), I think the question's OK. If it's something dull like needing special routines to load data into the GPU's memory and everything else is identical to ordinary arrays, I'd say it's off-topic. $\endgroup$ – David Richerby Jan 11 '16 at 6:24
  • $\begingroup$ It is a computer architecture, studied in the course of computer engeneering (hardware). Here is CS, a SW theory community. $\endgroup$ – Valentin Tihomirov Jan 11 '16 at 12:53
  • $\begingroup$ I thought Computer science stack exchange was meant all types of general theory computer science questions be it related to even computer engineering. $\endgroup$ – musicakc Jan 11 '16 at 13:19

Libgpuarray is package (like in proxy or wrapper) around cuda and opencl ndarray - meaning that computation is done on device side (GPU side) as opposed to host side (CPU).
This is described in documentation, and also defined what were the goals of this particular library.

It makes sense to talk about "faster" in terms of GPU if we are having a lot of data, which can be solved on different threads or vectorised (SIMT - new to Flynn taxonomy due to massive parallel but limited computation).

Strictly sequential algorithms benefit nothing, CPU has higher power for them, because GPU cores are slower.
It is not like it is fancy to compute on GPU disregarding problem statement.

On GPU you have smaller and constrainef memory, you have to take bandwidth (sending data from host to device, computation time and sending results from device to host) ti know whether there is speed up or slow down effect on your program.


Most probably, a GPU array is an array which is stored and processed on the GPU. Operations on the GPU are faster than those on the CPU, which is why you'd want to use such an array.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.