diff --git a/src/backends.jl b/src/backends.jl index 3b5a29a..cd9969a 100644 --- a/src/backends.jl +++ b/src/backends.jl @@ -78,3 +78,12 @@ const StridedBackend = Union{StridedNative, StridedBLAS} Backend for tensor operations that is based on the NVIDIA cuTENSOR library. """ struct cuTENSORBackend <: AbstractBackend end + +# Reactant backend +#----------------- +""" + ReactantBackend + +Backend for tensor operations that work on top of [Reactant.jl](https://github.com/EnzymeAD/Reactant.jl) library. +""" +struct ReactantBackend <: AbstractBackend end diff --git a/src/implementation/allocator.jl b/src/implementation/allocator.jl index 7ac5ea8..6244cfe 100644 --- a/src/implementation/allocator.jl +++ b/src/implementation/allocator.jl @@ -70,6 +70,16 @@ mutable struct BufferAllocator{Storage} end end +""" + ReactantAllocator{IsTraced} + +Allocator for [Reactant](https://github.com/EnzymeAD/Reactant.jl)-backed arrays. +If `IsTraced=true`, it is supposed that [Reactant](https://github.com/EnzymeAD/Reactant.jl) +is tracing the code and thus, it will return a `TracedRArray`. Otherwise, it will allocate a +`ConcreteRArray`. +""" +struct ReactantAllocator{IsTraced} end + const DefaultStorageType = @static isdefined(Core, :Memory) ? Memory{UInt8} : Vector{UInt8} BufferAllocator(; kwargs...) = BufferAllocator{DefaultStorageType}(; kwargs...)