Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ Leonid Genkin <lgenkin@nvidia.com>
Lior Paz <liorpa@nvidia.com>
Luis E. Pena <l31g@hotmail.com>
Manjunath Gorentla Venkata <manjugv@gmail.com>
Manu Shantharam <manu.shantharam@amd.com>
Marek Schimara <Marek.Schimara@bull.net>
Mark Allen <markalle@us.ibm.com>
Matthew Baker <bakermb@ornl.gov>
Expand Down
18 changes: 17 additions & 1 deletion config/m4/rocm.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) Advanced Micro Devices, Inc. 2016 - 2023. ALL RIGHTS RESERVED.
# Copyright (C) Advanced Micro Devices, Inc. 2016 - 2026. ALL RIGHTS RESERVED.
# Copyright (c) NVIDIA CORPORATION & AFFILIATES, 2001-2018. ALL RIGHTS RESERVED.
# See file LICENSE for terms.
#
Expand Down Expand Up @@ -97,6 +97,22 @@ AS_IF([test "x$with_rocm" != "xno"],
AC_SUBST([ROCM_LIBS])
AC_SUBST([ROCM_ROOT])],
[AC_MSG_WARN([ROCm not found])])

AS_IF([test "x$rocm_happy" = "xyes"],
[HIP_BUILD_FLAGS([$with_rocm], [HIP_LIBS], [HIP_LDFLAGS], [HIP_CPPFLAGS])
CPPFLAGS="$HIP_CPPFLAGS $CPPFLAGS"

AC_MSG_CHECKING([for HIP version])
AC_COMPUTE_INT([hip_version], [HIP_VERSION],
[#include <hip_version.h>],
[hip_version=0])
AC_MSG_RESULT(["$hip_version"])
CPPFLAGS="$SAVE_CPPFLAGS"])

AS_IF([test "$hip_version" -ge 70000000],
[AC_DEFINE([HAVE_ROCM_RESERVED_ADDR_TYPE], [1],
Comment thread
tvegas1 marked this conversation as resolved.
Resolved
[ROCm 7.0+ has HSA_EXT_POINTER_TYPE_RESERVED_ADDR])])

AC_CHECK_FUNCS([hsa_amd_portable_export_dmabuf])

CPPFLAGS="$SAVE_CPPFLAGS"
Expand Down
11 changes: 9 additions & 2 deletions src/uct/rocm/base/rocm_base.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) Advanced Micro Devices, Inc. 2019-2023. ALL RIGHTS RESERVED.
* Copyright (C) Advanced Micro Devices, Inc. 2019-2026. ALL RIGHTS RESERVED.
* See file LICENSE for terms.
*/

Expand Down Expand Up @@ -251,7 +251,14 @@ hsa_status_t uct_rocm_base_get_ptr_info(void *ptr, size_t size, void **base_ptr,
*base_size = info.sizeInBytes;
}
if (dev_type != NULL) {
if (info.type == HSA_EXT_POINTER_TYPE_UNKNOWN) {
/* HSA_EXT_POINTER_TYPE_RESERVED_ADDR check is required
* for rocm7+ for hip managed memory
*/
if ((info.type == HSA_EXT_POINTER_TYPE_UNKNOWN)
#ifdef HAVE_ROCM_RESERVED_ADDR_TYPE
Comment thread
tvegas1 marked this conversation as resolved.
Resolved
|| (info.type == HSA_EXT_POINTER_TYPE_RESERVED_ADDR)
#endif
) {
*dev_type = HSA_DEVICE_TYPE_CPU;
} else {
status = hsa_agent_get_info(info.agentOwner, HSA_AGENT_INFO_DEVICE,
Expand Down
Loading