From 4ac8346383a9db59dfc9956b617bbad829eb5a5f Mon Sep 17 00:00:00 2001 From: Michael LIAO Date: Mon, 23 Nov 2020 13:42:21 -0500 Subject: [PATCH] Add initalize `_wassert` support. Change-Id: I8922867ec77c975cdb235276fffc3c6272253a11 --- include/hip/hcc_detail/device_functions.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/hip/hcc_detail/device_functions.h b/include/hip/hcc_detail/device_functions.h index 82a4c446a3..515b4cc6a4 100644 --- a/include/hip/hcc_detail/device_functions.h +++ b/include/hip/hcc_detail/device_functions.h @@ -1223,6 +1223,13 @@ void abort() { // size of the calling function. Additionally, the weak attribute // allows the function to exist as a global although its definition is // included in every compilation unit. +#if defined(_WIN32) || defined(_WIN64) +extern "C" __device__ __attribute__((noinline)) __attribute__((weak)) +void _wassert(const wchar_t *_msg, const wchar_t *_file, unsigned _line) { + // FIXME: Need `wchar_t` support to generate assertion message. + __builtin_trap(); +} +#else /* defined(_WIN32) || defined(_WIN64) */ extern "C" __device__ __attribute__((noinline)) __attribute__((weak)) void __assert_fail(const char * __assertion, const char *__file, @@ -1244,6 +1251,7 @@ void __assertfail(const char * __assertion, // ignore all the args for now. __builtin_trap(); } +#endif /* defined(_WIN32) || defined(_WIN64) */ __device__ inline