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 7d6144d commit 2fed7c5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions benchmarks/setup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +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]
props = oneL0.memory_properties(device)[1]
@info props
return (props.totalSize - props.freeSize) / (1024 * 1024)
# 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)
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 2fed7c5

Please sign in to comment.