Open kmp5VT opened 4 months ago
With this implementation, JACC
will not work if the preference doesn't match loaded libraries. For example
julia> using JACC
julia> JACC.JACCPreferences.backend
"amdgpu"
julia> JACC.zeros(3)
ERROR: The backend amdgpu is either not recognized or the associated package is not loaded.
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] arraytype(::Val{:amdgpu})
@ JACC ~/.julia/dev/JACC.jl/src/helper.jl:15
[3] arraytype()
@ JACC ~/.julia/dev/JACC.jl/src/helper.jl:13
[4] zeros(::Int64)
@ JACC ~/.julia/dev/JACC.jl/src/array.jl:3
[5] top-level scope
@ REPL[969]:1
Also the code can now be precompiled without issue
All AMD, CUDA and CPU tests now pass. I cannot check oneapi because I don't yet have access to an intel GPU
@kmp5VT please see my previous comment
This is rewritten to utilize Julia traits written in a way that replicates SimpleTraits.jl. The traits in this way will only allow one to utilize one backend at a time which is still managed by
Preferences
. In this way JACC does not overload theBase.Array
name but is still able to construct an array generically using anarray
function.One issue with this design is when one lauches JACC
JACC.JAT = JACCArrayType{Array}
regardless of the preference. Then when one loads the proper backend to match preferencesJAT
will be reset to reflect the desired preference.