Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/backends.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 10 additions & 0 deletions src/implementation/allocator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment thread
mofeing marked this conversation as resolved.

const DefaultStorageType = @static isdefined(Core, :Memory) ? Memory{UInt8} : Vector{UInt8}
BufferAllocator(; kwargs...) = BufferAllocator{DefaultStorageType}(; kwargs...)

Expand Down
Loading