Skip to content

Commit

Permalink
rocm: add subconfigure.m4 script
Browse files Browse the repository at this point in the history
  • Loading branch information
gcongiu committed Jul 25, 2023
1 parent ac4f9ba commit c28f680
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/components/rocm/subconfigure.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[#] start of __file__

for comp in ${components} ; do
if test "${comp}" = "rocm" ; then
CPPFLAGS_OLD=${CPPFLAGS}
CPPFLAGS="-I${PAPI_ROCM_ROOT}/include/hsa -I${PAPI_ROCM_ROOT}/include/rocprofiler"

AC_CHECK_HEADERS(hsa.h, rocprofiler.h)

if test "${ac_cv_header_hsa_h}" = "no" ; then
AC_MSG_ERROR([Can't find hsa.h])
fi

if test "${ac_cv_header_rocprofiler_h}" = "no" ; then
AC_MSG_ERROR([Can't find rocprofiler.h])
fi

CPPFLAGS=${CPPFLAGS_OLD}
fi
done
3 changes: 3 additions & 0 deletions src/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
/* Define if hrtime_t is defined in <sys/time.h> */
#undef HAVE_HRTIME_T

/* Define to 1 if you have the <hsa.h> header file. */
#undef HAVE_HSA_H

/* Define to 1 if you have the <intrinsics.h> header file. */
#undef HAVE_INTRINSICS_H

Expand Down
33 changes: 33 additions & 0 deletions src/configure
Original file line number Diff line number Diff line change
Expand Up @@ -7169,6 +7169,39 @@ CFLAGS="$CFLAGS -DPAPI_NUM_COMP=$PAPI_NUM_COMP"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $components" >&5
$as_echo "$components" >&6; }
# start of components/rocm/subconfigure.m4
for comp in ${components} ; do
if test "${comp}" = "rocm" ; then
CPPFLAGS_OLD=${CPPFLAGS}
CPPFLAGS="-I${PAPI_ROCM_ROOT}/include/hsa -I${PAPI_ROCM_ROOT}/include/rocprofiler"
for ac_header in hsa.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "hsa.h" "ac_cv_header_hsa_h" "$ac_includes_default"
if test "x$ac_cv_header_hsa_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_HSA_H 1
_ACEOF
rocprofiler.h
fi
done
if test "${ac_cv_header_hsa_h}" = "no" ; then
as_fn_error $? "Can't find hsa.h" "$LINENO" 5
fi
if test "${ac_cv_header_rocprofiler_h}" = "no" ; then
as_fn_error $? "Can't find rocprofiler.h" "$LINENO" 5
fi
CPPFLAGS=${CPPFLAGS_OLD}
fi
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PAPI event CSV filename to use" >&5
$as_echo_n "checking for PAPI event CSV filename to use... " >&6; }
if test "x$PAPI_EVENTS_CSV" == "x"; then
Expand Down
2 changes: 2 additions & 0 deletions src/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -2056,6 +2056,8 @@ CFLAGS="$CFLAGS -DPAPI_NUM_COMP=$PAPI_NUM_COMP"

AC_MSG_RESULT($components)

m4_include([components/rocm/subconfigure.m4])

AC_MSG_CHECKING(for PAPI event CSV filename to use)
if test "x$PAPI_EVENTS_CSV" == "x"; then
PAPI_EVENTS_CSV="papi_events.csv"
Expand Down

0 comments on commit c28f680

Please sign in to comment.