chapel icon indicating copy to clipboard operation
chapel copied to clipboard

[Feature Request]: Argmax and argmin functions for tuples and arrays

Open Iainmon opened this issue 1 year ago • 6 comments

Summary of Feature

Description: Add argmax and argmin functions for arrays and homogeneous tuples.

Is this issue currently blocking your progress? No. I have come up with a solution, but it is linear time in the length of array and only works for rank = 1 arrays. No solution for tuple.

Iainmon avatar Jul 26 '24 22:07 Iainmon

Are argmax/argmin like Chapel's maxloc/minloc reductions?

bradcray avatar Jul 26 '24 23:07 bradcray

Yes, it appears they are. Before I close, is the status of their GPU compatibility known?

Iainmon avatar Jul 26 '24 23:07 Iainmon

minloc and maxloc reductions are available on GPUs for arrays

jabraham17 avatar Jul 26 '24 23:07 jabraham17

See https://github.com/chapel-lang/chapel/issues/24932. I think minloc/maxloc reductions on GPUs are relatively small amount of effort and we can support them soon enough if that's needed.

In the meantime we have gpuMinLocReduce and gpuMaxLocReduce in the GPU module as placeholders.

e-kayrakli avatar Jul 26 '24 23:07 e-kayrakli

I stand corrected. Disappointing 😢

jabraham17 avatar Jul 26 '24 23:07 jabraham17

@Iainmon : Since this is covered by #24932, can we close this one? Or if not, update the title and description to be more about porting the reductions to GPUs?

bradcray avatar Aug 12 '24 19:08 bradcray