Skip to content

Commit

Permalink
Add check for hipcc
Browse files Browse the repository at this point in the history
Signed-off-by: Joseph Schuchart <joseph.schuchart@stonybrook.edu>
  • Loading branch information
devreal committed Jul 8, 2024
1 parent 5fbc2d4 commit a4a84f5
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 22 deletions.
51 changes: 51 additions & 0 deletions config/opal_check_hipcc.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
dnl -*- autoconf -*-
dnl
dnl Copyright (c) 2024 Stony Brook University. All rights reserved.
dnl
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl

dnl
dnl Check for HIPCC and bail out if HIPCC was requested
dnl Options provided:
dnl --with-hipcc[=path/to/hipcc]: provide a path to HIPCC
dnl --enable-hipcc: require HIPCC, bail out if not found
dnl

AC_DEFUN([OPAL_CHECK_HIPCC],[
# This option is probably only helpful to developers: have
# configure fail if Sphinx is not found (i.e., if you don't have
# the ability to use Sphinx to build the HTML docs and man pages).
AC_ARG_ENABLE([hipcc],
[AS_HELP_STRING([--enable-hipcc],
[Force configure to fail if CUDA hipcc is not found (CUDA hipcc is used to build CUDA operator support).])])
AC_ARG_WITH([hipcc],
[AS_HELP_STRING([--with-hipcc=DIR],
[Path to the CUDA compiler])])
AS_IF([test -n "$with_hipcc"],
[OPAL_HIPCC=$with_hipcc],
# no path specified, try to find hipcc
[AC_PATH_PROG([OPAL_HIPCC], [hipcc], [])])
# If the user requested to disable sphinx, then pretend we didn't
# find it.
AS_IF([test "$enable_hipcc" = "no"],
[OPAL_HIPCC=])
# If --enable-sphinx was specified and we did not find Sphinx,
# abort. This is likely only useful to prevent "oops!" moments
# from developers.
AS_IF([test -z "$OPAL_HIPCC" && test "$enable_hipcc" = "yes"],
[AC_MSG_WARN([A suitable CUDA compiler was not found, but --enable-hipcc was specified])
AC_MSG_ERROR([Cannot continue])])
OPAL_SUMMARY_ADD([Accelerators], [HIPCC compiler], [], [$OPAL_HIPCC])
])
29 changes: 9 additions & 20 deletions config/opal_check_nvcc.m4
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
dnl -*- autoconf -*-
dnl
dnl Copyright (c) 2020-2022 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2024 Jeffrey M. Squyres. All rights reserved.
dnl Copyright (c) 2024 Stony Brook University. All rights reserved.
dnl
dnl $COPYRIGHT$
dnl
Expand All @@ -10,26 +9,16 @@ dnl
dnl $HEADER$
dnl

dnl Setup Sphinx for building HTML docs and man pages
dnl
dnl 1 -> sanity file to check if pre-built docs are already available
dnl You probably want to pass something like
dnl "$srcdir/docs/_build/man/foo.1"
dnl Check for NVCC and bail out if NVCC was requested
dnl Options provided:
dnl --with-nvcc[=path/to/nvcc]: provide a path to NVCC
dnl --enable-nvcc: require NVCC, bail out if not found
dnl --nvcc-compute-arch: request a specific compute
dnl architecture for the operator
dnl kernels
dnl
dnl 2 -> (OPTIONAL) URL to display in AC_MSG_WARN when docs will not be installed
dnl If $2 is empty, nothing will be displayed.
dnl Note: if $2 contains a #, be sure to double quote it
dnl (e.g., [[https://example.com/foo.html#some-anchor]])
dnl
dnl 3 -> (OPTIONAL) Filename of requirements.txt-like file containing
dnl the required Pip modules (to be displayed if rendering a
dnl simple RST project fails).
dnl
dnl This macro requires that OAC_PUSH_PREFIX was previously called.
dnl The pushed prefix may be used if this macro chooses to set {OAC
dnl prefix}_MAKEDIST_DISABLE. If set, it is a message indicating why
dnl "make dist" should be disabled, suitable for emitting via
dnl AC_MSG_WARN.

AC_DEFUN([OPAL_CHECK_NVCC],[
# This option is probably only helpful to developers: have
Expand Down
2 changes: 1 addition & 1 deletion ompi/mca/op/rocm/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ rocm_sources = op_rocm_impl.hip

HIPCC = hipcc

.cpp.l$(OBJEXT):
.hip.l$(OBJEXT):
$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(HIPCC) -O2 -std=c++17 -fvectorize -prefer-non-pic -Wc,-fPIC,-g -c $<

Expand Down
5 changes: 4 additions & 1 deletion ompi/mca/op/rocm/configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@ AC_DEFUN([MCA_ompi_op_rocm_CONFIG],[
AC_CONFIG_FILES([ompi/mca/op/rocm/Makefile])

OPAL_CHECK_ROCM([op_rocm])
OPAL_CHECK_HIPCC([op_hipcc])

AS_IF([test "x$ROCM_SUPPORT" = "x1"],
AS_IF([test "x$ROCM_SUPPORT" = "x1" -a -n "$OPAL_HIPCC"],
[$1],
[$2])

AC_SUBST([op_rocm_CPPFLAGS])
AC_SUBST([op_rocm_LDFLAGS])
AC_SUBST([op_rocm_LIBS])

AC_SUBST([OPAL_HIPCC])

])dnl

0 comments on commit a4a84f5

Please sign in to comment.