Poplar and PopLibs
Checking.hpp
1// Copyright (c) 2019 Graphcore Ltd. All rights reserved.
2
3#ifndef poplar_Checking_hpp_
4#define poplar_Checking_hpp_
5
6namespace poplar_rt {
7namespace detail {
8
9[[noreturn]] void assert_fail(const char *msg);
10}
11} // namespace poplar_rt
12
13#ifdef ENABLE_POPLAR_RUNTIME_CHECKS
14#define POPLAR_RUNTIME_ASSERT(e, msg) \
15 do { \
16 if (!(e)) { \
17 poplar_rt::detail::assert_fail(msg); \
18 } \
19 } while (0)
20#else
21#define POPLAR_RUNTIME_ASSERT(e, msg) ((void)(0 ? !(e) : 0))
22#endif
23
24#endif // poplar_Checking_hpp_