diff --git a/src/uct/api/device/uct_device_impl.h b/src/uct/api/device/uct_device_impl.h index 310827a243b..b054ab3d83c 100644 --- a/src/uct/api/device/uct_device_impl.h +++ b/src/uct/api/device/uct_device_impl.h @@ -12,16 +12,18 @@ #include #include -#if __has_include() && \ - __has_include() +#if (defined(HAVE_CUDA) || \ + (!defined(HAVE_CONFIG_H) && __has_include() && __has_include())) #include #define UCT_CUDA_IPC_SUPPORTED 1 #else #define UCT_CUDA_IPC_SUPPORTED 0 #endif -#if __has_include() && \ - __has_include() +#if (defined(HAVE_GDA) || \ + (!defined(HAVE_CONFIG_H) && \ + __has_include() && \ + __has_include())) #include #define UCT_RC_MLX5_GDA_SUPPORTED 1 #else diff --git a/src/uct/ib/mlx5/gdaki/configure.m4 b/src/uct/ib/mlx5/gdaki/configure.m4 index aa00759e214..0329a272c33 100644 --- a/src/uct/ib/mlx5/gdaki/configure.m4 +++ b/src/uct/ib/mlx5/gdaki/configure.m4 @@ -9,11 +9,13 @@ AC_ARG_WITH([gda], [AS_HELP_STRING([--without-gda], [Disable GDA-KI])], [], [with_gda=yes]) -AS_IF([test "x$with_gda" = "xyes"] && [test "x$cuda_happy" = "xyes"], +AS_IF([test "x$with_gda" = "xyes"] && [test "x$cuda_happy" = "xyes"] && + [test "x$have_mlx5" = "xyes"], [gda_happy=yes], [gda_happy=no]) AS_IF([test "x$gda_happy" = "xyes"], - [uct_ib_mlx5_modules="${uct_ib_mlx5_modules}:gda"]) + [uct_ib_mlx5_modules="${uct_ib_mlx5_modules}:gda" + AC_DEFINE([HAVE_GDA], [1], [Enable GDA-KI support])]) AM_CONDITIONAL([HAVE_GDA], [test "x$gda_happy" != "xno"]) AC_CONFIG_FILES([src/uct/ib/mlx5/gdaki/Makefile diff --git a/test/gtest/ucp/cuda/test_kernels.cu b/test/gtest/ucp/cuda/test_kernels.cu index 18a5dc7ff9a..164f4431766 100644 --- a/test/gtest/ucp/cuda/test_kernels.cu +++ b/test/gtest/ucp/cuda/test_kernels.cu @@ -4,6 +4,10 @@ * See file LICENSE for terms. */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include "test_kernels.h" #include diff --git a/test/gtest/uct/cuda/test_kernels.cu b/test/gtest/uct/cuda/test_kernels.cu index ca28709880a..36f830b3a7a 100644 --- a/test/gtest/uct/cuda/test_kernels.cu +++ b/test/gtest/uct/cuda/test_kernels.cu @@ -4,6 +4,10 @@ * See file LICENSE for terms. */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include "test_kernels.h" #include diff --git a/test/gtest/uct/cuda/test_kernels_uct.cu b/test/gtest/uct/cuda/test_kernels_uct.cu index 4665f5cf5db..023a204b21c 100644 --- a/test/gtest/uct/cuda/test_kernels_uct.cu +++ b/test/gtest/uct/cuda/test_kernels_uct.cu @@ -4,6 +4,10 @@ * See file LICENSE for terms. */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include "test_kernels_uct.h" #include