Skip to content

Revert "Fancy private"

Churavy, Valentin requested to merge revert-175-vc/fancy_private into master

Created by: vchuravy

Reverts JuliaGPU/KernelAbstractions.jl#175 @mjulian31 and I were looking at some code and this regresses KernelAbstractions CPU code quite a bit. Julia+LLVM can't reason through the allocation code (even after attempting to fix in 38db33c3)

@kernel function mykern(out, A)
         I = @index(Global, NTuple)
         i = @index(Local)
         
         priv = @private eltype(A) (1,)
         @inbounds begin
           priv[1] = zero(eltype(A))
           for k in 1:size(A, ndims(A))
             priv[1] += A[I..., k]
           end
           out[I...] = priv[1]
         end
       end
A = rand(64, 64, 3);
B = zeros(64, 64);
mykern(CPU(), (8,8))(B, A, ndrange=size(B))

yields 8*8 allocations of MArrays.

Merge request reports

Loading