Skip to content

Commit

Permalink
Merge pull request kokkos#7774 from Rombur/fix_rocm53
Browse files Browse the repository at this point in the history
Fix ROCm 5.3
  • Loading branch information
dalg24 authored Feb 15, 2025
2 parents eaecee2 + 535d27c commit d67f012
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions core/src/HIP/Kokkos_HIP_Space.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ void* HIPSpace::impl_allocate(const int device_id,
const size_t arg_logical_size,
[[maybe_unused]] bool stream_sync_only) const {
void* ptr = nullptr;
// ROCm 5.5 and earlier throw an error when using hipMallocAsync and
// arg_alloc_size is zero. Instead of trying to allocate memory, just return
// early.
if (arg_alloc_size == 0) return ptr;

KOKKOS_IMPL_HIP_SAFE_CALL(hipSetDevice(device_id));

#ifdef KOKKOS_ENABLE_IMPL_HIP_MALLOC_ASYNC
Expand Down
2 changes: 1 addition & 1 deletion core/unit_test/TestNonTrivialScalarTypes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ struct array_reduce {
KOKKOS_INLINE_FUNCTION
array_reduce &operator=(const array_reduce &src) {
// ROCm 5.5 and earlier returns the wrong result when early return is enable
#if !defined(KOKKOKS_ENABLE_HIP) || (HIP_VERSION_MAJOR > 5) || \
#if !defined(KOKKOS_ENABLE_HIP) || (HIP_VERSION_MAJOR > 5) || \
((HIP_VERSION_MAJOR == 5) && (HIP_VERSION_MINOR >= 6))
if (&src == this) return *this;
#endif
Expand Down

0 comments on commit d67f012

Please sign in to comment.