Xcur
MModular
•Created by Xcur on 1/8/2024 in #questions
Alias does not work with raises String methods
I have a string i know at compile time and I was writing a function to split it into each of the new lines, but because split has a raises flag it cannot be run at compile time and stored as an alias. I noticed there is a TODO to allow this, and im curious when will alias work with potentially raising functions?
Here is my sample code:
2 replies
MModular
•Created by Xcur on 12/8/2023 in #questions
Can i have a list of structs with different parameters?
Lets say I have a struct like the one below, is it possible to have a list of structs that have different values inside their compile time parameters? This is just a sample struct, I know it's trivial and you wouldn't create a Name struct but this is just demonstrate the concept.
I could only implement it if I had DataSize as the same for each, but I would like to have a list of different DataSize name structs.
Is there a way to abstract it away, by using traits with all the necessary methods and then a wrapper struct that holds a name field with the trait as its type that I put each Name struct into? Then I could put the wrapper struct as a parameter in DynamicVector?
2 replies
MModular
•Created by Xcur on 12/5/2023 in #questions
Mojo GPU Syntax or specific GPU stdlib data types?
I'm looking forward to using MAX, I'm curious though outside of MAX how will the GPU syntax look? Will we need to use different data types other than SIMD that will be specific for GPU's like what is kind of done with cuda in C++? I'm hoping to be able to test this outside of AI paradigms that I couldn't use MAX for, like maybe improving the speed of opencv-like smoothing kernels or ray tracing.
4 replies
MModular
•Created by Xcur on 11/14/2023 in #questions
How will the syntax look when mojo supports GPUs?
I'm wondering when people build operators like matmul will they have to write a function for CPU and a very different function for the GPU? Or will the syntax remain relatively similar, and the same function can be used on both? It will just take advantage of hardware acceleration when it is available.
2 replies