Fix assert declaration & add a compile test (#303)

This commit is contained in:
Changho Hwang
2024-05-19 19:39:30 -07:00
committed by GitHub
parent d35a2f2dc2
commit f76eae4dca
3 changed files with 14 additions and 2 deletions

View File

@@ -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

View File

@@ -10,4 +10,5 @@ target_sources(unit_tests PRIVATE
socket_tests.cc
utils_tests.cc
utils_internal_tests.cc
compile_tests.cu
)

View File

@@ -0,0 +1,11 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include <gtest/gtest.h>
#undef NDEBUG
#include <assert.h>
#include <mscclpp/poll_device.hpp>
TEST(CompileTest, Assert) { assert(true); }