DTypePointer to StaticTuple array

Suppose I have defined a static tuple x as follows: var x = StaticTuple[4, Float32](1.0, 2.0, 3.0, 4.0). Is it possible to create an instance of DTypePointer[DType.float32] from the address of x's underlying storage?
5 Replies
ModularBot
ModularBot11mo ago
Congrats @Leandro, you just advanced to level 2!
Maxim
Maxim11mo ago
I was wondering the same a couple of times. In fast base64 repo I ended up having an alias calling a function which defines a SIMD vector, allocates a DTypePointer of appropriate size and simd stores the values from simd vector into the pointer. I wonder if there is a better way though. E.g. static tuple or list literal…
Leandro Campos
Leandro CamposOP9mo ago
Hi, @Jack Clayton. Can you help me with this question? Now StaticTuple has the method as_ptr ❤️
Jack Clayton
Jack Clayton9mo ago
Awesome! Sorry must have missed this
Want results from more Discord servers?
Add your server