Loading...
Searching...
No Matches
Error.h File Reference
`#include <sstream>`
`#include <stdexcept>`
`#include "Debug.h"`
`#include "runtime/HalideRuntime.h"`

Go to the source code of this file.

## Classes

struct | Halide::Error
| A base class for Halide errors. More...
struct | Halide::RuntimeError
| An error that occurs while running a JIT-compiled Halide pipeline. More...
struct | Halide::CompileError
| An error that occurs while compiling a Halide pipeline that Halide attributes to a user error. More...
struct | Halide::InternalError
| An error that occurs while compiling a Halide pipeline that Halide attributes to an internal compiler bug, or to an invalid use of Halide's internals. More...
class | Halide::CompileTimeErrorReporter
| CompileTimeErrorReporter is used at compile time (not runtime) when an error or warning is generated by Halide. More...
struct | Halide::Internal::ReportBase< T >
struct | Halide::Internal::ErrorReport< Exception >
struct | Halide::Internal::WarningReport

## Namespaces

namespace | Halide
| This file defines the class FunctionDAG, which is our representation of a Halide pipeline, and contains methods to using Halide's bounds tools to query properties of it.
namespace | Halide::Internal

## Macros

#define | user_warning _halide_user_warning
#define | user_error _halide_error_impl(Halide::CompileError)
#define | internal_error _halide_error_impl(Halide::InternalError)
#define | halide_runtime_error _halide_error_impl(Halide::RuntimeError)
#define | internal_assert(c)
#define | user_assert(c)
#define | _halide_user_error _halide_error_impl(Halide::CompileError)
#define | _halide_internal_error _halide_error_impl(Halide::InternalError)
#define | _halide_runtime_error _halide_error_impl(Halide::RuntimeError)
#define | _halide_internal_assert(c)
#define | _halide_user_assert(c)
#define | _halide_error_impl(type)
| The following three diagnostic macros are implemented such that the message is evaluated only if the assertion's value is false.
#define | _halide_assert_impl(condition, type)
| The following three diagnostic macros are implemented such that the message is evaluated only if the assertion's value is false.
#define | _halide_user_warning
| The following three diagnostic macros are implemented such that the message is evaluated only if the assertion's value is false.

## Functions

bool | Halide::exceptions_enabled ()
| Query whether Halide was compiled with exceptions.
void | Halide::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 calls abort (if not).
void | Halide::Internal::issue_warning (const char *warning)
| If a custom error reporter is configured, notifies the reporter by calling its warning() function.
HALIDE_EXPORT_SYMBOL void | Halide::Internal::unhandled_exception_handler ()
void | Halide::Internal::throw_error (const RuntimeError &e)
| If a custom error reporter is configured, notifies the reporter by calling its error() function with the value of `e.what()`.
void | Halide::Internal::throw_error (const CompileError &e)
| If a custom error reporter is configured, notifies the reporter by calling its error() function with the value of `e.what()`.
void | Halide::Internal::throw_error (const InternalError &e)
| If a custom error reporter is configured, notifies the reporter by calling its error() function with the value of `e.what()`.

## Macro Definition Documentation

## _halide_error_impl

#define _halide_error_impl | ( |  | type | ) |

Value:
for (Halide::Internal::ErrorReport<type> _err; 1; _err.issue()) \
_err.init(__FILE__, __FUNCTION__, __LINE__, nullptr)
Halide::Internal::ErrorReport
Definition Error.h:164
Halide::Internal::ErrorReport::issue
void issue() noexcept(false)
Definition Error.h:169

The following three diagnostic macros are implemented such that the message is evaluated only if the assertion's value is false.

This (regrettably) requires a macro to work, but has the highly desirable effect that all assertion parameters are totally skipped (not ever evaluated) when the assertion is true.

The macros work by deferring the call to issue() until after the stream has been evaluated. This previously used a trick where ErrorReport would throw in the destructor, but throwing in a destructor is UB in a lot of scenarios, and it was easy to break things by mistake.

Definition at line 198 of file Error.h.

## _halide_assert_impl

#define _halide_assert_impl | ( |  | condition,
|  |  | type )

Value:
if (!(condition)) \
for (Halide::Internal::ErrorReport<type> _err; 1; _err.issue()) \
/*****/ _err.init(__FILE__, __FUNCTION__, __LINE__, #condition)

The following three diagnostic macros are implemented such that the message is evaluated only if the assertion's value is false.

This (regrettably) requires a macro to work, but has the highly desirable effect that all assertion parameters are totally skipped (not ever evaluated) when the assertion is true.

The macros work by deferring the call to issue() until after the stream has been evaluated. This previously used a trick where ErrorReport would throw in the destructor, but throwing in a destructor is UB in a lot of scenarios, and it was easy to break things by mistake.

Definition at line 202 of file Error.h.

## _halide_user_warning

#define _halide_user_warning

Value:
for (Halide::Internal::WarningReport _err; _err; _err.issue()) \
_err.init(__FILE__, __FUNCTION__, __LINE__, nullptr)
Halide::Internal::WarningReport
Definition Error.h:174
Halide::Internal::WarningReport::issue
void issue()
Definition Error.h:179

The following three diagnostic macros are implemented such that the message is evaluated only if the assertion's value is false.

This (regrettably) requires a macro to work, but has the highly desirable effect that all assertion parameters are totally skipped (not ever evaluated) when the assertion is true.

The macros work by deferring the call to issue() until after the stream has been evaluated. This previously used a trick where ErrorReport would throw in the destructor, but throwing in a destructor is UB in a lot of scenarios, and it was easy to break things by mistake.

Definition at line 207 of file Error.h.

## user_warning

#define user_warning _halide_user_warning

Definition at line 212 of file Error.h.

## user_error

#define user_error _halide_error_impl(Halide::CompileError)

Definition at line 214 of file Error.h.

Referenced by Halide::Internal::GeneratorInput_Buffer< T >::begin(), Halide::Internal::GeneratorInput_Buffer< T >::end(), Halide::Internal::enum_to_string(), Halide::Internal::Autoscheduler::ParamParser::finish(), Halide::Internal::GeneratorParam_Arithmetic< T >::get_c_type(), Halide::Internal::GeneratorParam_LoopLevel::set_from_string(), and Halide::Internal::GeneratorParam_Synthetic< T >::set_from_string().

## internal_error

#define internal_error _halide_error_impl(Halide::InternalError)

Definition at line 215 of file Error.h.

Referenced by Halide::Internal::GeneratorParam_LoopLevel::call_to_string(), Halide::Internal::GeneratorParam_Synthetic< T >::call_to_string(), Halide::Internal::IRMatcher::fuzz_test_rule(), Halide::Internal::Scope< T >::get(), Halide::Internal::GeneratorParam_Synthetic< T >::get_c_type(), Halide::Internal::GeneratorParam_LoopLevel::get_default_value(), Halide::Internal::GeneratorParam_Synthetic< T >::get_default_value(), Halide::Internal::IRMatcher::Intrin< intrin, Args >::make(), Halide::Internal::IRMatcher::Intrin< intrin, Args >::make_folded_const(), and Halide::Internal::Scope< T >::ref().

## halide_runtime_error

#define halide_runtime_error _halide_error_impl(Halide::RuntimeError)

Definition at line 216 of file Error.h.

## internal_assert

#define internal_assert | ( |  | c | ) |

Value:
_halide_assert_impl(c, Halide::InternalError)
_halide_assert_impl
#define _halide_assert_impl(condition, type)
The following three diagnostic macros are implemented such that the message is evaluated only if the ...
Definition Error.h:202
Halide::InternalError
An error that occurs while compiling a Halide pipeline that Halide attributes to an internal compiler...
Definition Error.h:68

Definition at line 218 of file Error.h.

Referenced by Halide::Internal::Autoscheduler::MemInfo< typename MemTraits< T >::MemInfoType >::add_access_info(), Halide::Internal::GeneratorOutputBase::as(), Halide::Internal::Autoscheduler::MemInfo< typename MemTraits< T >::MemInfoType >::efficiency(), Halide::Internal::Autoscheduler::StateQueue::emplace(), Halide::Internal::StubInput::expr(), Halide::ExternFuncArgument::ExternFuncArgument(), Halide::ExternSignature::ExternSignature(), Halide::Internal::Autoscheduler::ThreadInfo::for_each_thread_id_in_tail_warp(), Halide::Internal::StubInput::func(), Halide::Internal::GeneratorOutput_Buffer< T >::GeneratorOutput_Buffer(), Halide::Internal::GeneratorOutput_Buffer< T >::GeneratorOutput_Buffer(), Halide::Internal::GeneratorOutput_Buffer< T >::GeneratorOutput_Buffer(), Halide::Internal::GeneratorOutput_Buffer< T >::GeneratorOutput_Buffer(), Halide::Internal::get_element(), Halide::Internal::get_element(), Halide::Internal::HexagonAlignmentAnalyzer::HexagonAlignmentAnalyzer(), Halide::Internal::Interval::Interval(), Halide::Internal::HexagonAlignmentAnalyzer::is_aligned_impl(), Halide::Type::narrow(), Halide::Internal::Autoscheduler::Strides::offset(), Halide::Internal::GeneratorOutput_Buffer< T >::operator OutputImageParam(), Halide::Internal::Autoscheduler::LoadJacobian::operator()(), Halide::Internal::Function::Compare::operator()(), Halide::Internal::ReductionDomain::Compare::operator()(), Halide::Internal::Autoscheduler::LoadJacobian::operator*(), Halide::Internal::GeneratorOutput_Buffer< T >::operator=(), Halide::Internal::StubInput::parameter(), Halide::Internal::Autoscheduler::StateQueue::pop(), Halide::Internal::Scope< T >::pop(), Halide::ExternSignature::ret_type(), Halide::Internal::GeneratorOutput_Func< T >::set_estimate(), Halide::Internal::GeneratorOutput_Buffer< T >::set_estimates(), Halide::Internal::GeneratorOutput_Func< T >::set_estimates(), Halide::Stage::Stage(), and Halide::Internal::Autoscheduler::ThreadInfo::ThreadInfo().

## user_assert

#define user_assert | ( |  | c | ) |

Value:
_halide_assert_impl(c, Halide::CompileError)
Halide::CompileError
An error that occurs while compiling a Halide pipeline that Halide attributes to a user error.
Definition Error.h:58

Definition at line 219 of file Error.h.

Referenced by Halide::Internal::Autoscheduler::approx_eq(), Halide::Internal::GeneratorOutputBase::as(), Halide::Internal::check_types(), Halide::Internal::GeneratorBase::claim_name(), Halide::Internal::enum_from_string(), Halide::evaluate(), Halide::evaluate_may_gpu(), Halide::Internal::Autoscheduler::expect(), Halide::Internal::Autoscheduler::expect_eq(), Halide::Realization::operator Buffer< T, Dims >(), Halide::Internal::GeneratorInput_Buffer< T >::operator ImageParam(), Halide::Internal::GeneratorOutput_Buffer< T >::operator OutputImageParam(), Halide::Internal::GeneratorInput_Buffer< T >::operator StubInputBuffer< T2 >(), Halide::Internal::GeneratorOutput_Buffer< T >::operator=(), Halide::Tuple::operator[](), Halide::Tuple::operator[](), Halide::Internal::parse_scalar(), Halide::Internal::GeneratorInput_Scalar< T >::set_estimate(), Halide::Internal::GeneratorOutput_Buffer< T >::set_estimates(), Halide::Internal::GeneratorParam_Arithmetic< T >::set_from_string(), Halide::Internal::GeneratorParam_Bool< T >::set_from_string(), Halide::Internal::GeneratorParam_Enum< T >::set_from_string(), Halide::Internal::GeneratorParam_Arithmetic< T >::set_impl(), Halide::Internal::GeneratorBase::set_inputs(), Halide::Internal::GeneratorInput_Scalar< T >::TBaseToExpr(), Halide::Tuple::Tuple(), and Halide::Type::Type().

## _halide_user_error

#define _halide_user_error _halide_error_impl(Halide::CompileError)

Definition at line 225 of file Error.h.

## _halide_internal_error

#define _halide_internal_error _halide_error_impl(Halide::InternalError)

Definition at line 226 of file Error.h.

## _halide_runtime_error

#define _halide_runtime_error _halide_error_impl(Halide::RuntimeError)

Definition at line 227 of file Error.h.

## _halide_internal_assert

#define _halide_internal_assert | ( |  | c | ) |

Value:
_halide_assert_impl(c, Halide::InternalError)

Definition at line 228 of file Error.h.

## _halide_user_assert

#define _halide_user_assert | ( |  | c | ) |

Value:
_halide_assert_impl(c, Halide::CompileError)

Definition at line 229 of file Error.h.