4
$\begingroup$

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.

$\endgroup$
4
  • $\begingroup$ Not sure this is on-topic here... $\endgroup$ Commented Jan 11, 2016 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$ Commented Jan 11, 2016 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$ Commented Jan 11, 2016 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
    Commented Jan 11, 2016 at 13:19

2 Answers 2

4
$\begingroup$

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.

$\endgroup$
0
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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