Hello,
I’m a new user coming from Python and C.
I would like to:
- create a struct with arrays of known length as attribute.
- Be able to update these arrays after the creation
- Be able to allocate a multitude of these structs contiguously in memory
- Copy this block to a CUDA device
I tried multiple packages like StaticArrays
and StructArrays
but I can’t seem to find a solution that satisfies all these constraints.
A SVector
+StaticArray
generates the struct I want but I’m not able to update the arrays.
To make it clearer for people with experience in python/numpy/c. This is what I want to achieve:
np.empty(5, dtype=np.dtype([
('field', (np.int32, 5)
])
or in C
struct test {
int field[5];
};
calloc(5, sizeof(struct test));
Thank you for your help