Viskores  1.0
Assert.h
Go to the documentation of this file.
1 //============================================================================
2 // The contents of this file are covered by the Viskores license. See
3 // LICENSE.txt for details.
4 //
5 // By contributing to this file, all contributors agree to the Developer
6 // Certificate of Origin Version 1.1 (DCO 1.1) as stated in DCO.txt.
7 //============================================================================
8 
9 //============================================================================
10 // Copyright (c) Kitware, Inc.
11 // All rights reserved.
12 // See LICENSE.txt for details.
13 //
14 // This software is distributed WITHOUT ANY WARRANTY; without even
15 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 // PURPOSE. See the above copyright notice for more information.
17 //============================================================================
18 
19 #ifndef viskores_Assert_h
20 #define viskores_Assert_h
21 
23 
24 #include <cassert>
25 
26 // Pick up conditions where we want to turn on/off assert.
27 #ifndef VISKORES_NO_ASSERT
28 #if defined(NDEBUG)
29 #define VISKORES_NO_ASSERT
30 #elif defined(VISKORES_CUDA_DEVICE_PASS) && defined(VISKORES_NO_ASSERT_CUDA)
31 #define VISKORES_NO_ASSERT
32 #elif defined(VISKORES_HIP) && defined(VISKORES_NO_ASSERT_HIP)
33 #define VISKORES_NO_ASSERT
34 #endif
35 #endif // VISKORES_NO_ASSERT
36 
50 #ifndef VISKORES_NO_ASSERT
51 #define VISKORES_ASSERT(condition) assert(condition)
52 #define VISKORES_ASSERTS_CHECKED
53 #else
54 #define VISKORES_ASSERT(condition) (void)(condition)
55 #endif
56 
57 #endif //viskores_Assert_h
Configure.h