M
Modular15mo ago
Helehex

how do you disambiguate function calls

also, can you disambiguate between these two:
fn __mul__(self, other: MY_SIMD[type,1]):
// splat multiply
fn __mul__(self, other: MY_SIMD[type,simd_width]):
// flat multiply
...

MY_SIMD[type,1]*MY_SIMD[type,1] // error: ambiguous call to '__mul__'
fn __mul__(self, other: MY_SIMD[type,1]):
// splat multiply
fn __mul__(self, other: MY_SIMD[type,simd_width]):
// flat multiply
...

MY_SIMD[type,1]*MY_SIMD[type,1] // error: ambiguous call to '__mul__'
i can call it splat_mul() instead
5 Replies
Helehex
HelehexOP15mo ago
it works for builtin simd maybe uses one function? implicit cast splat from SIMD[type, 1] to SIMD[type,simd_width] MLIR stuff?
Moosems / Three chickens
There’s no way for the compiler to determine which one you’re attempting to call, that’s why it’s ambiguous.
Helehex
HelehexOP15mo ago
how does mojo do it
Moosems / Three chickens
There’s plenty of things they do that users can’t do right now (take the Tuple as an example) but I guess this is probably a question for @Jack Clayton.
Jack Clayton
Jack Clayton15mo ago
I'm not sure what's happening here, can you show me what type and MY_SIMD implementations look like?
Want results from more Discord servers?
Add your server