Skip to content

Commit cfefec4

Browse files
committed
Support Adapt.AbstractGPUDevice
1 parent d329830 commit cfefec4

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/device/array.jl

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
# Contiguous on-device arrays
22

3-
export ROCDeviceArray, ROCDeviceVector, ROCDeviceMatrix, ROCBoundsError
3+
export ROCDevice, ROCDeviceArray, ROCDeviceVector, ROCDeviceMatrix, ROCBoundsError
4+
5+
6+
# ToDo: This is not sufficient/general enough (doesn't support multiple devices)
7+
# What's the AMDGPU equivalent of CUDA.CuDevice?
8+
"""
9+
struct ROCDevice <: AbstractGPUDevice
10+
11+
A ROC device.
12+
"""
13+
struct ROCDevice <: AbstractGPUDevice end
14+
15+
# ToDo: This is not sufficient/general enough:
16+
Adapt.adapt_storage(::ROCDevice, x) = adapt_storage(ROCArray, x)
17+
18+
# ToDo: implement Sys.total_memory(dev::ROCDevice)
19+
# ToDo: implement Sys.free_memory(dev::ROCDevice)
20+
421

522
# construction
623

0 commit comments

Comments
 (0)