Skip to content

Commit d437bbc

Browse files
committed
WIP Support Adapt.AbstractGPUDevice
1 parent 99967b7 commit d437bbc

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/agent.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Utilities for working with HSA agents
22

3-
mutable struct HSAAgent
3+
mutable struct HSAAgent <: AbstractGPUDevice
44
agent::HSA.Agent
55

66
# Cached information
@@ -26,6 +26,14 @@ const DEFAULT_AGENT = Ref{HSAAgent}()
2626
const ALL_AGENTS = Vector{HSAAgent}()
2727
const AGENTS = IdDict{UInt64, HSAAgent}() # Map from agent handles to HSAAgent structs
2828

29+
30+
# ToDo: This is not sufficient/general enough, doesn't handle multiple devices:
31+
Adapt.adapt_storage(::HSAAgent, x) = adapt_storage(ROCArray, x)
32+
33+
# ToDo: implement Sys.total_memory(dev::ROCDevice)
34+
# ToDo: implement Sys.free_memory(dev::ROCDevice)
35+
36+
2937
### @cfunction callbacks ###
3038

3139
function agent_iterate_isas_cb(isa::HSA.ISA, isas)

0 commit comments

Comments
 (0)