You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the title says, is there a way to support ThreadsX.argmin and ThreadsX.argmax?
Sorry I am too new with Julia to be able to help.
The way I see it is to define the argmax reduction
oneargmax((mxi,mx),(i,ai)) = (mx<ai) ? (i,ai) : (mxi,mx)
# but I do not know how to define the generic initial value for the foldl/reduce in ThreadsXmyargmax(f, itr; init=(nothing,-1)) = ThreadsX.mapreduce(identity, oneargmax, zip(itr,Iterators.map(f,itr)); simd =Val(true), init)
The text was updated successfully, but these errors were encountered:
I think I didn't implement them since there was no argmax(f, xs) etc. in Base before Julia 1.7. Now that we already have 1.7-rc, I think it's safe to implement them here.
I think your function is a useful implementation, but, to nitpick, we need to use isless instead of < for Base-compatibility.
You are not nitpicking, you are informing.
I have resolved my need for this with explicit initial values and I am getting great performance from an old Xeon Phi with 256 threads
As the title says, is there a way to support
ThreadsX.argmin
andThreadsX.argmax
?Sorry I am too new with Julia to be able to help.
The way I see it is to define the argmax reduction
The text was updated successfully, but these errors were encountered: