Multidimensional Arrays
GRABNER Friedrich
[please enable javascript to see the address]
Wed Feb 10 16:32:53 CET 2016
Dear Matthias,
I am trying to implement a little stencil operation, which requires a 3D array.
With this in mind I have tested the Memory<float_v, 8, 3, true> which I understand should initialise an array of 8x3 with padding...
This works well, but is there any momentum for expanding this functionality to 3+ dimension vectors, well I only ideally wish to use 3D but whilst we are thinking about it.
Moreover, how can I have truly dynamic arrays?
The example given does not really have a dynamic array:
size_t size = 11;
Vc::Memory<int_v> array(size);
// scalar access:
for (size_t i = 0; i < array.entriesCount(); ++i) {
array[i] = i;
}
// vector access:
for (size_t i = 0; i < array.vectorsCount(); ++i) {
array.vector(i) = int_v::IndexesFromZero() + i * int_v::Size;
}
It is not critical to my work but I think it is definitely a useful function especially for loop unrolling etc. by the compiler...
Anyhow I will have a look at the implementation of the 2D arrays, maybe it is simple and I can save you the work, but I feel this is unlikely ;)
Thanks for your time and looking forward to hearing from you,
Friedrich M. Grabner
More information about the Vc
mailing list