1 #ifndef HALIDE_RUNTIME_PRINTER_H
2 #define HALIDE_RUNTIME_PRINTER_H
29 template<
int type, u
int64_t length = 1024>
37 Printer(
void *ctx,
char *mem =
nullptr)
41 }
else if (length <=
sizeof(
scratch)) {
102 Printer &write_float16_from_bits(
const uint16_t arg) {
122 msan_annotate_is_initialized();
126 return allocation_error();
158 const char *allocation_error() {
159 return "Printer buffer allocation failed.\n";
162 void msan_annotate_is_initialized() {
170 msan_annotate_is_initialized();
194 SinkPrinter
operator<<(
const SinkPrinter &s, T) {
198 typedef Printer<BasicPrinter>
print;
199 typedef Printer<ErrorPrinter> error;
200 typedef Printer<StringStreamPrinter> stringstream;
203 typedef Printer<BasicPrinter> debug;
205 typedef SinkPrinter debug;
double halide_float16_bits_to_double(uint16_t)
Read bits representing a half precision floating point number and return the double that represents t...
int halide_msan_annotate_memory_is_initialized(void *user_context, const void *ptr, uint64_t len)
Annotate that a given range of memory has been initialized; only used when Target::MSAN is enabled.
void halide_print(void *user_context, const char *)
Print a message to stderr.
void halide_error(void *user_context, const char *)
Halide calls this function on runtime errors (for example bounds checking failures).
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
std::ostream & operator<<(std::ostream &stream, const Expr &)
Emit an expression on an output stream (such as std::cout) in human-readable form.
Expr print(const std::vector< Expr > &values)
Create an Expr that prints out its value whenever it is evaluated.
char scratch[length<=256 ? length :1]
unsigned __INT64_TYPE__ uint64_t
WEAK char * halide_buffer_to_string(char *dst, char *end, const halide_buffer_t *arg)
signed __INT64_TYPE__ int64_t
WEAK char * halide_uint64_to_string(char *dst, char *end, uint64_t arg, int digits)
WEAK char * halide_double_to_string(char *dst, char *end, double arg, int scientific)
signed __INT32_TYPE__ int32_t
WEAK char * halide_string_to_string(char *dst, char *end, const char *arg)
unsigned __INT16_TYPE__ uint16_t
WEAK char * halide_type_to_string(char *dst, char *end, const halide_type_t *arg)
unsigned __INT32_TYPE__ uint32_t
WEAK char * halide_pointer_to_string(char *dst, char *end, const void *arg)
WEAK char * halide_int64_to_string(char *dst, char *end, int64_t arg, int digits)
The raw representation of an image passed around by generated Halide code.
A runtime tag for a type in the halide type system.