0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-05-18 10:53:48 +02:00

configure: Configurations for AMD ROCm support.

This commit is contained in:
Jason Volk 2022-10-30 18:51:21 +00:00
parent 231a5305ca
commit a5fb379aee

View file

@ -2507,6 +2507,72 @@ AM_COND_IF([DRM],
IRCD_DEFINE(USE_DRM, [0], [DRM support is not available])
])
dnl
dnl
dnl AMD ROCm
dnl
dnl
AC_SUBST(ROCM_CPPFLAGS, [])
AC_SUBST(ROCM_LDFLAGS, [])
AC_SUBST(ROCM_LIBS, [])
AC_ARG_WITH(rocm-includes,
RB_HELP_STRING([--with-rocm-includes=[[[DIR]]]], [Path to ROCm include directory]),
[
rocm_incdir="$withval"
ROCM_CPPFLAGS="-isystem $withval -isystem ${withval}/hsa"
], [])
AC_ARG_WITH(rocm-libs,
RB_HELP_STRING([--with-rocm-libs=[[[DIR]]]], [Path to ROCm library directory]),
[
rocm_libdir="$withval"
ROCM_LDFLAGS="-L$withval"
], [])
dnl push
restore_cppflags=$CPPFLAGS
restore_ldflags=$LDFLAGS
RB_VAR_PREPEND([CPPFLAGS], [$ROCM_CPPFLAGS])
RB_VAR_PREPEND([LDFLAGS], [$ROCM_LDFLAGS])
RB_CHK_SYSHEADER(rocm_version.h, [ROCM_VERSION_H])
PKG_CHECK_MODULES(rocm, [rocm-core],
[
have_rocm="yes"
], [
AC_CHECK_LIB(rocm-core, getROCmVersion,
[
have_rocm="yes"
], [
have_rocm="no"
])
])
dnl pop
CPPFLAGS=$restore_cppflags
LDFLAGS=$restore_ldflags
AC_MSG_CHECKING(whether to disable use of any found ROCm)
AC_ARG_ENABLE(rocm, RB_HELP_STRING([--disable-rocm], [Disable ROCm support]),
[
AC_MSG_RESULT([$enableval])
enable_rocm=$enableval
], [
AC_MSG_RESULT([no])
enable_rocm="yes"
])
AM_CONDITIONAL([ROCM], [test "x$have_rocm" = "xyes" && test "x$enable_rocm" = "xyes" ])
AM_COND_IF([ROCM],
[
IRCD_DEFINE(USE_ROCM, [1], [ROCm support is available and enabled])
], [
IRCD_DEFINE(USE_ROCM, [0], [ROCm support is not available])
])
dnl
dnl
dnl OpenCL
@ -3122,6 +3188,7 @@ echo "PBC support ....................... $have_pbc"
echo "LLVM library support .............. $have_libllvm"
echo "DRM support ....................... $have_drm"
echo "ARM NN support .................... $have_armnn"
echo "AMD ROCm support .................. $have_rocm"
echo "OpenCL support .................... $have_opencl"
echo "Liburing support .................. $have_uring"
echo "Memory allocator .................. $alloc_lib"