#ifndef HALIDE_DEBUG_H
#define HALIDE_DEBUG_H
#include <iostream>
#include <string>
#include <stdlib.h>
#include "Introspection.h"
namespace Halide {
struct Expr;
struct Type;
EXPORT std::ostream &operator<<(std::ostream &stream, const Expr &);
EXPORT std::ostream &operator<<(std::ostream &stream, const Type &);
class Module;
EXPORT std::ostream &operator<<(std::ostream &stream, const Module &);
namespace Internal {
struct Stmt;
EXPORT std::ostream &operator<<(std::ostream &stream, const Stmt &);
struct LoweredFunc;
EXPORT std::ostream &operator << (std::ostream &, const LoweredFunc &);
class debug {
const bool logging;
public:
debug(int verbosity) : logging(verbosity <= debug_level()) {}
template<typename T>
debug &operator<<(T&& x) {
if (logging) {
std::cerr << std::forward<T>(x);
}
return *this;
}
EXPORT static int debug_level();
};
}
}
#endif