Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
Dale-Black committed Jan 20, 2025
1 parent 2fed7c5 commit 3f6ea2e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions benchmarks/setup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ function monitor_gpu_memory(backend::String, duration=0.1)
elseif backend == "oneAPI"
# Get the first device since that's what we're using
device = oneAPI.devices()[1]
# Get total memory from device properties
total_mem = oneAPI.oneL0.memory_properties(device)[1].totalSize
# Get free memory from device
free_mem = oneAPI.oneL0.memory_get_info(device).free
return Float64(total_mem - free_mem) / (1024 * 1024)
# Get memory properties
props = oneAPI.oneL0.memory_properties(device)[1]
@info props
# For now, just return total memory since free memory isn't easily accessible
return Float64(props.totalSize) / (1024 * 1024)
elseif backend == "AMDGPU"
free_mem, total_mem = AMDGPU.Runtime.Mem.info() # Use the correct memory info function
return Float64(total_mem - free_mem) / (1024 * 1024)
Expand Down

0 comments on commit 3f6ea2e

Please sign in to comment.