diff --git a/include/mscclpp/poll_device.hpp b/include/mscclpp/poll_device.hpp index 9ad116f8..90104bd2 100644 --- a/include/mscclpp/poll_device.hpp +++ b/include/mscclpp/poll_device.hpp @@ -17,8 +17,8 @@ extern "C" __device__ void __assert_fail(const char *__assertion, const char *__file, unsigned int __line, const char *__function); #else // !defined(MSCCLPP_DEVICE_HIP) -extern "C" __device__ void __assert_fail(const char *__assertion, const char *__file, unsigned int __line, - const char *__function) __THROW; +extern "C" __host__ __device__ void __assert_fail(const char *__assertion, const char *__file, unsigned int __line, + const char *__function) __THROW; #endif // !defined(MSCCLPP_DEVICE_HIP) #endif // NDEBUG diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt index e86bc825..0f010f4a 100644 --- a/test/unit/CMakeLists.txt +++ b/test/unit/CMakeLists.txt @@ -10,4 +10,5 @@ target_sources(unit_tests PRIVATE socket_tests.cc utils_tests.cc utils_internal_tests.cc + compile_tests.cu ) diff --git a/test/unit/compile_tests.cu b/test/unit/compile_tests.cu new file mode 100644 index 00000000..2b732b85 --- /dev/null +++ b/test/unit/compile_tests.cu @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +#include + +#undef NDEBUG +#include + +#include + +TEST(CompileTest, Assert) { assert(true); }