Skip to content

Commit f7550cb

Browse files
authored
Free buffers synchronously if async caching is disabled. (#21668)
Signed-off-by: Andrew Woloszyn <[email protected]>
1 parent 23f4fab commit f7550cb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

runtime/src/iree/hal/drivers/hip/hip_device.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,11 @@ static void iree_hal_hip_async_buffer_release(
10061006
iree_hal_hip_device_t* device = (iree_hal_hip_device_t*)user_data;
10071007
void* ptr = iree_hal_hip_buffer_device_pointer(buffer);
10081008
if (ptr) {
1009-
iree_hal_hip_allocator_free_async(device->device_allocator, buffer);
1009+
if (device->params.async_caching) {
1010+
iree_hal_hip_allocator_free_async(device->device_allocator, buffer);
1011+
} else {
1012+
iree_hal_hip_allocator_free_sync(device->device_allocator, buffer);
1013+
}
10101014
}
10111015
}
10121016

0 commit comments

Comments
 (0)