Any examples of algorithm.reduction.argmax usage?
I am writing fast where function, and from description argwhere looks like a good candidate but can't figure out how to use it. For example what is OutputChainPtr?
@always_inline
fn where(self, val: Int8, vec: DTypePointer[DType.int8]):
@parameter
fn w[nelts : Int](i : Int):
var res = (self.values.simd_load[nelts](i) == val)
#algorithm.reduction.argmax
algorithm.vectorize[nelts, w](ar_size*ar_size)
6 Replies
@Jack Clayton hi, any help here? I have spent a week trying to find a way to use SIMD for tasks like argwhere(
I spent some time playing with this, and it didn't work as I expected it to, will have to get back to you on this one @zverianskii
hi @Jack Clayton no new so far?
Hi @zverianskii it's very low level at the moment:
Thanks, @Jack Clayton . So, does this function only return a single element? The documentation says it "Finds the indices of the maximum element along the specified axis." I was actually expecting it to return multiple indices if there are repeated elements, which is why I'm interested in this function.
Congrats @zverianskii, you just advanced to level 2!