diff --git a/src/agent.jl b/src/agent.jl index 9b33d9d31..ae76d9d5d 100644 --- a/src/agent.jl +++ b/src/agent.jl @@ -1,6 +1,6 @@ # Utilities for working with HSA agents -mutable struct HSAAgent +mutable struct HSAAgent <: AbstractGPUDevice agent::HSA.Agent # Cached information @@ -26,6 +26,14 @@ const DEFAULT_AGENT = Ref{HSAAgent}() const ALL_AGENTS = Vector{HSAAgent}() const AGENTS = IdDict{UInt64, HSAAgent}() # Map from agent handles to HSAAgent structs + +# ToDo: This is not sufficient/general enough, doesn't handle multiple devices: +Adapt.adapt_storage(device::HSAAgent, x) = adapt_storage(ROCArray, x) + +# ToDo: implement Sys.total_memory(dev::ROCDevice) +# ToDo: implement Sys.free_memory(dev::ROCDevice) + + ### @cfunction callbacks ### function agent_iterate_isas_cb(isa::HSA.ISA, isas)