VTK-m  2.2
Assert.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 
11 #ifndef vtk_m_Assert_h
12 #define vtk_m_Assert_h
13 
15 
16 #include <cassert>
17 
18 // Pick up conditions where we want to turn on/off assert.
19 #ifndef VTKM_NO_ASSERT
20 #if defined(NDEBUG)
21 #define VTKM_NO_ASSERT
22 #elif defined(VTKM_CUDA_DEVICE_PASS) && defined(VTKM_NO_ASSERT_CUDA)
23 #define VTKM_NO_ASSERT
24 #elif defined(VTKM_HIP) && defined(VTKM_NO_ASSERT_HIP)
25 #define VTKM_NO_ASSERT
26 #endif
27 #endif // VTKM_NO_ASSERT
28 
42 #ifndef VTKM_NO_ASSERT
43 #define VTKM_ASSERT(condition) assert(condition)
44 #define VTKM_ASSERTS_CHECKED
45 #else
46 #define VTKM_ASSERT(condition) (void)(condition)
47 #endif
48 
49 #endif //vtk_m_Assert_h
Configure.h