Initializing CuArrays

wiktorkujawa
Sun, 25 Aug 2019 23:24:39 +0000
General Usage

How to initialize this type of array:
ArrayName=cu(fill([0.0f0,0.0f0],(20,20,5))),
I don’t want to use Tuples because there are too many problems with math operations doing on them(they can’t for example increment and work with @atomic statements).
I mean I can do something like

ArrayName=cu(fill((0.0f0,0.0f0),(20,20,5)));
#in @cuda kernel
@atomic ArrayName[Index]= ArrayName[Index].+SomeDataValues

, but I get undefined operation error, when I use it that way. So i would prefer using Arrays of Array:

ArrayName=cu(fill((0.0f0,0.0f0),(20,20,5)));
@atomic ArrayName[Index]+=SomeDataValues

I know that the easiest way is to double Arrays(I mean to create two single Arrays instead of double one), but it would be slower and I would have to duplicate code.

1 post - 1 participant