16 struct Error :
public std::runtime_error {
50 virtual void warning(
const char *msg) = 0;
51 virtual void error(
const char *msg) = 0;
72 std::ostringstream
msg;
96 #if __cplusplus >= 201100 || _MSC_VER >= 1900
130 #define _halide_internal_assertion(condition, flags) \
132 (condition) ? (void)0 : ::Halide::Internal::Voidifier() & ::Halide::Internal::ErrorReport(__FILE__, __LINE__, #condition, flags).ref()
134 #define internal_error Halide::Internal::ErrorReport(__FILE__, __LINE__, nullptr, 0)
135 #define user_error Halide::Internal::ErrorReport(__FILE__, __LINE__, nullptr, Halide::Internal::ErrorReport::User)
136 #define user_warning Halide::Internal::ErrorReport(__FILE__, __LINE__, nullptr, Halide::Internal::ErrorReport::User | Halide::Internal::ErrorReport::Warning)
137 #define halide_runtime_error Halide::Internal::ErrorReport(__FILE__, __LINE__, nullptr, Halide::Internal::ErrorReport::User | Halide::Internal::ErrorReport::Runtime)
139 #define internal_assert(c) _halide_internal_assertion(c, 0)
140 #define user_assert(c) _halide_internal_assertion(c, Halide::Internal::ErrorReport::User)
146 #define _halide_user_assert(c) _halide_internal_assertion(c, Halide::Internal::ErrorReport::User)
Defines functions for debug logging during code generation.
This file declares the routines used by Halide internally in its runtime.
#define HALIDE_ALWAYS_INLINE
CompileTimeErrorReporter is used at compile time (not runtime) when an error or warning is generated ...
virtual void warning(const char *msg)=0
virtual void error(const char *msg)=0
virtual ~CompileTimeErrorReporter()=default
HALIDE_ALWAYS_INLINE void operator&(ErrorReport &)
HALIDE_ALWAYS_INLINE Voidifier()=default
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
bool exceptions_enabled()
Query whether Halide was compiled with exceptions.
void set_custom_compile_time_error_reporter(CompileTimeErrorReporter *error_reporter)
The default error reporter logs to stderr, then throws an exception (if HALIDE_WITH_EXCEPTIONS) or ca...
An error that occurs while compiling a Halide pipeline that Halide attributes to a user error.
CompileError(const std::string &msg)
A base class for Halide errors.
Error(const std::string &msg)
ErrorReport(const char *f, int l, const char *cs, int flags)
~ErrorReport()
When you're done using << on the object, and let it fall out of scope, this errors out,...
ErrorReport & operator<<(const T &x)
HALIDE_ALWAYS_INLINE ErrorReport & ref()
An error that occurs while compiling a Halide pipeline that Halide attributes to an internal compiler...
InternalError(const std::string &msg)
An error that occurs while running a JIT-compiled Halide pipeline.
RuntimeError(const std::string &msg)