正在加载...
正在搜索...
无匹配项
assert.cuh
1/*
2 * 版权所有 (c) 2023, NVIDIA CORPORATION.
3 *
4 * 根据 Apache 许可证 2.0 版(“许可证”)获得许可;
5 * 除非符合许可证的规定,否则您不得使用此文件。
6 * 您可以在以下位置获取许可证的副本:
7 *
8 * https://apache.ac.cn/licenses/LICENSE-2.0
9 *
10 * 除非适用法律要求或书面同意,否则软件
11 * 根据许可证分发,按“原样”提供,
12 * 不附带任何明示或暗示的保证或条件。
13 * 请参阅许可证以了解特定语言的管理权限和
14 * 限制。
15 */
16
17#pragma once
18
19#include <cuda_runtime.h>
20
28#if !defined(NDEBUG) && defined(__CUDA_ARCH__) && (defined(__clang__) || defined(__GNUC__))
29#define __ASSERT_STR_HELPER(x) #x
30#define cuspatial_assert(e) \
31 ((e) ? static_cast<void>(0) \
32 : __assert_fail(__ASSERT_STR_HELPER(e), __FILE__, __LINE__, __PRETTY_FUNCTION__))
33#else
34#define cuspatial_assert(e) (static_cast<void>(0))
35#endif