Skip to content

Commit

Permalink
Fall back to hipFree for asynchronous deallocations in ROCm 5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fwyzard committed Dec 15, 2023
1 parent 39aa327 commit fb8b559
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/alpaka/core/ApiHipRt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ namespace alpaka
// hipFreeAsync is implemented only in ROCm 5.2.0 and later.
# if HIP_VERSION >= 50'600'000
return ::hipFreeAsync(devPtr, stream);
# elif HIP_VERSION >= 50'200'000
# elif HIP_VERSION >= 50'300'000
// before ROCm 5.6.0, hipFreeAsync fails on a null pointer deallocation
if(devPtr)
{
Expand All @@ -194,6 +194,9 @@ namespace alpaka
{
return ::hipSuccess;
}
# elif HIP_VERSION >= 50'200'000
// in ROCm 5.2.x, hipFreeAsync makes a subsequent hipStreamDestroy hang
return ::hipFree(devPtr);
# else
// Not implemented.
return errorUnknown;
Expand Down

0 comments on commit fb8b559

Please sign in to comment.