NKspartan
NKspartan
MModular
Created by NKspartan on 5/14/2024 in #questions
Will mojo support JIT compilation?
Oh okay, that’s what I thought. Well thank you for the explanation anyway
25 replies
MModular
Created by NKspartan on 5/14/2024 in #questions
Will mojo support JIT compilation?
Okay so even max can have more optimization thanks to also lowering the kernels to mlir. One question the first mlir code did you write it manually or did you get from running the function in mojo, because I wanted to know how to see the compiled mlir code from mojo
25 replies
MModular
Created by NKspartan on 5/14/2024 in #questions
Will mojo support JIT compilation?
okay so max is also a separate compiler you are saying (that's what i was somewhat thinking), in the same way jax uses xla, okay. So now my question is how could i write that in mojo hahah. But thank you for you help sora as always.
25 replies
MModular
Created by NKspartan on 5/14/2024 in #questions
Will mojo support JIT compilation?
you think. I'm just asking about this because i feel like if mojo wants to be an AI language I think things like being able to pass run time values to parameters should be possible, because the reason jax, pytorch and others can do many things while the code is easy and simple to write, is thanks to this no?, like being able to use the python as the runtime and from there doing compiling to create efficient code. But maybe i'm wrong because i don't understand how the max engine works so because i don't know they do things in the max engine maybe that's why I think it is necessary.
25 replies
MModular
Created by NKspartan on 5/14/2024 in #questions
Will mojo support JIT compilation?
yeah but i'm talking about things like being able to pass run time variables to parameters (not arguments) in functions. Like right now there isn't a way to do this type of things, from what i know
25 replies
MModular
Created by Geo7 on 10/18/2023 in #questions
How to store Struct(or string) into DynamicVector
you can do it using pointers:
var myVector = DynamicVector[Pointer[MyStruct]] ()
var myStructInstance = MyStruct(1, 2)
var hello = __get_lvalue_as_address(myStructInstance) # Get address of value

myVector.push_back(hello)
print(__get_address_as_lvalue(myVector[0].address).field2) # get the address of the value and then convert it to a reference (lvalue)
var myVector = DynamicVector[Pointer[MyStruct]] ()
var myStructInstance = MyStruct(1, 2)
var hello = __get_lvalue_as_address(myStructInstance) # Get address of value

myVector.push_back(hello)
print(__get_address_as_lvalue(myVector[0].address).field2) # get the address of the value and then convert it to a reference (lvalue)
7 replies