Skip to content

Commit

Permalink
Update Architectures.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses authored Jan 29, 2025
1 parent 20e3836 commit 0cf9c8f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Architectures.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,17 @@ struct ReactantState <: AbstractSerialArchitecture end

device(::CPU) = KernelAbstractions.CPU()
device(::GPU) = CUDA.CUDABackend(; always_inline=true)
# While there is no Reactant backend this worls
# While there is no Reactant backend this works
# KA assumes that an array type for storage corresponds one to
# one with the device it executes on. for example, CuArrays must
# execute on a cuda kernel (and not host or AMD kernel), and only
# cuarrays can be passed to a cuda kernel. Reactant has no such
# restriction and a cpu array cuarray or reactant array can be
# executed on any backend. currently Reactant does not define a backend
# for execution and will import whatever host or kernel is called.
# this says thay reactant will import the cuda kernel version of the code
# which makes some optimizations easier. Reactant may still execute the
# code on CPU GPU or TPU dependong on what its default client is.
device(::ReactantState) = CUDA.CUDABackend(; always_inline=true)

architecture() = nothing
Expand Down

0 comments on commit 0cf9c8f

Please sign in to comment.