0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-25 23:14:13 +01:00

configure: Add AMD GPU Performance API support.

This commit is contained in:
Jason Volk 2022-11-01 02:06:21 +00:00
parent a5fb379aee
commit 1fd8e9954e

View file

@ -2573,6 +2573,72 @@ AM_COND_IF([ROCM],
IRCD_DEFINE(USE_ROCM, [0], [ROCm support is not available])
])
dnl
dnl
dnl GPU Perf API (GPA)
dnl
dnl
AC_SUBST(GPA_CPPFLAGS, [])
AC_SUBST(GPA_LDFLAGS, [])
AC_SUBST(GPA_LIBS, [])
AC_ARG_WITH(gpa-includes,
RB_HELP_STRING([--with-gpa-includes=[[[DIR]]]], [Path to GPA include directory]),
[
gpa_incdir="$withval"
GPA_CPPFLAGS="-isystem $withval"
], [])
AC_ARG_WITH(gpa-libs,
RB_HELP_STRING([--with-gpa-libs=[[[DIR]]]], [Path to GPA library directory]),
[
gpa_libdir="$withval"
GPA_LDFLAGS="-L$withval"
], [])
dnl push
restore_cppflags=$CPPFLAGS
restore_ldflags=$LDFLAGS
RB_VAR_PREPEND([CPPFLAGS], [$GPA_CPPFLAGS])
RB_VAR_PREPEND([LDFLAGS], [$GPA_LDFLAGS])
RB_CHK_SYSHEADER(gpu_performance_api/gpu_perf_api.h, [GPU_PERF_API_H])
PKG_CHECK_MODULES(gpa, [GPUPerfAPIVK],
[
have_gpa="yes"
], [
AC_CHECK_LIB(GPUPerfAPIVK, GpaGetVersion,
[
have_gpa="yes"
], [
have_gpa="no"
])
])
dnl pop
CPPFLAGS=$restore_cppflags
LDFLAGS=$restore_ldflags
AC_MSG_CHECKING(whether to disable use of any found GPA)
AC_ARG_ENABLE(gpa, RB_HELP_STRING([--disable-gpa], [Disable GPA support]),
[
AC_MSG_RESULT([$enableval])
enable_gpa=$enableval
], [
AC_MSG_RESULT([no])
enable_gpa="yes"
])
AM_CONDITIONAL([GPA], [test "x$have_gpa" = "xyes" && test "x$enable_gpa" = "xyes" ])
AM_COND_IF([GPA],
[
IRCD_DEFINE(USE_GPA, [1], [GPA support is available and enabled])
], [
IRCD_DEFINE(USE_GPA, [0], [GPA support is not available])
])
dnl
dnl
dnl OpenCL
@ -3189,6 +3255,7 @@ echo "LLVM library support .............. $have_libllvm"
echo "DRM support ....................... $have_drm"
echo "ARM NN support .................... $have_armnn"
echo "AMD ROCm support .................. $have_rocm"
echo "AMD GPA support ................... $have_gpa"
echo "OpenCL support .................... $have_opencl"
echo "Liburing support .................. $have_uring"
echo "Memory allocator .................. $alloc_lib"