diff --git a/src/Type.h b/src/Type.h index 41d6f870846d..f281cba2ac93 100644 --- a/src/Type.h +++ b/src/Type.h @@ -446,6 +446,16 @@ struct Type { return type != other.type || (code() == Handle && !same_handle_type(other)); } + /** Compare two types for equality */ + bool operator==(const halide_type_t &other) const { + return type == other; + } + + /** Compare two types for inequality */ + bool operator!=(const halide_type_t &other) const { + return type != other; + } + /** Compare ordering of two types so they can be used in certain containers and algorithms */ bool operator<(const Type &other) const { if (type < other.type) { diff --git a/src/runtime/HalideBuffer.h b/src/runtime/HalideBuffer.h index 434866568cab..2c67a35f941c 100644 --- a/src/runtime/HalideBuffer.h +++ b/src/runtime/HalideBuffer.h @@ -130,7 +130,7 @@ struct DeviceRefCount { template class Buffer { /** The underlying halide_buffer_t */ - halide_buffer_t buf = {0}; + halide_buffer_t buf = {}; /** Some in-class storage for shape of the dimensions. */ halide_dimension_t shape[D];