JuliaORNL / JACC.jl

CPU/GPU parallel performance portable layer in Julia via functions as arguments
MIT License
19 stars 9 forks source link

Remove non-portable zeros ones signatures #81

Open williamfgc opened 4 months ago

williamfgc commented 4 months ago

Mostly looking for feedback as CUDA/AMDGPU return a Float32 and Julia Base returns a Float64.

kmp5VT commented 4 months ago

The code in parallel_reduce for threads is no longer working because it depends on the non-portable zeros and ones

function parallel_reduce(N::I, f::F, x...) where {I <: Integer, F <: Function}
    tmp = zeros(Threads.nthreads())
    ret = zeros(1)
   ...
end

The error

CG: Error During Test at /Users/kpierce/.julia/dev/JACC.jl/test/tests_threads.jl:100
  Got exception outside of a @test
  TypeError: in Array, in element type, expected Type, got a value of type Int64
  Stacktrace:

This can be fixed by using Base.zeros inside of JACC

williamfgc commented 4 months ago

I am not sure I'm following. JACC.zeros is removed, but somehow your code is still trying to use it. Maybe remove a previously compiled JACC in ~/.julia? The zeros in parallel_reduce should come from Base automatically. Still , good catch as we might make it Int64. Thanks!