JuliaORNL / JACC.jl

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

Internally handle array types #83

Closed kmp5VT closed 4 months ago

kmp5VT commented 4 months ago

As an effort to make it possible to handle more complex parameters into JACC functions, make an internal struct based roughly on SimpleTraits.jl which is used to dispatch JACC functions internally. This also removes the JACC.Array which currently overwrites the Base.Array name in favor of a JACC.array function which calls internally JACC.arraytype() and analyzes the const JACCArrayType struct which is built on startup of the application and depends on the loaded preferences of JACC.

kmp5VT commented 4 months ago

I am reworking with recent changes @williamfgc. But I have found issue with overwriting Array and then exporting it gives this

julia> using JACC
[ Info: Precompiling JACC [0979c8fe-16a4-4796-9b82-89a9f10403ea]
[ Info: Skipping precompilation since __precompile__(false). Importing JACC [0979c8fe-16a4-4796-9b82-89a9f10403ea].

julia> Array
WARNING: both JACC and Base export "Array"; uses of it in module Main must be qualified
ERROR: UndefVarError: `Array` not defined

julia> Array{Float32}(undef, 10)
ERROR: UndefVarError: `Array` not defined
Stacktrace:
 [1] top-level scope
   @ REPL[3]:1