Fix code generation, when scalars are used as zero dimensional arrays
commit1fcf424ea6d22464d99e27ca87e9513c821a6052
authorTobias Grosser <tobias@grosser.es>
Sun, 7 Aug 2011 22:55:24 +0000 (7 23:55 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Mon, 8 Aug 2011 07:01:03 +0000 (8 09:01 +0200)
tree5c37cb2e752e141ec031b0f47a3cf7f3df1aa2f7
parentc6a0c940ac832a5b2ac2196ce42bc32f46ba9f58
Fix code generation, when scalars are used as zero dimensional arrays

Scalars can be used not only to index an array or to store loop
iterators, but also to store data of a calculation. In case this
happens, and this data needs to be referenced they need a special
treatment.

This change makes sure that the code compiles and is correct. It still
copies the scalars into GPU memory and references them by pointer
indirection. This is correct and needed if a scalar is not read-only,
but its value is changed inside the scop and used afterwards. A possible
optimization for read-only scalars is to pass them directly as function
arguments.

Signed-off-by: Tobias Grosser <tobias@grosser.es>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
cuda.c