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
The following findfirst-like kernel fails when using CartesianIndices:
using oneAPI
functiondoit(xs)
# works
indices, dummy_index =eachindex(xs), 1# fails#indices, dummy_index = CartesianIndices(xs), CartesianIndex{ndims(xs)}()# given two pairs of (istrue, index), return the one with the smallest indexfunctionfindfirst_reduction(t1, t2)
(x, i), (y, j) = t1, t2
if i > j
t1, t2 = t2, t1
(x, i), (y, j) = t1, t2
end
x &&return t1
y &&return t2
return (false, dummy_index)
end
res =mapreduce(tuple, findfirst_reduction, xs, indices;
init = (false, dummy_index))
return res[1] ? res[2] :nothingendfunctionmain()
x = [falsefalse; truefalse]
@show i =doit(oneArray(x))
@assert i !==nothing@assert x[i]
end
The text was updated successfully, but these errors were encountered:
The following
findfirst
-like kernel fails when using CartesianIndices:The text was updated successfully, but these errors were encountered: