24#ifndef TVM_SUPPORT_IO_H_
25#define TVM_SUPPORT_IO_H_
41template <
typename T,
typename =
void>
65 virtual size_t Read(
void*
ptr,
size_t size) = 0;
73 virtual size_t Write(
const void*
ptr,
size_t size) = 0;
106 template <
typename T>
117 template <
typename T>
120 if (!
Read<T>(data +
i))
return false;
RAII wrapper function to enter and exit a context object similar to python's with syntax.
Definition with_context.h:59
Abstract binary stream for serialization.
Definition io.h:57
void WriteArray(const T *data, size_t num_elems)
Write an array of typed values element by element.
Definition io.h:107
virtual size_t Read(void *ptr, size_t size)=0
Read raw bytes from the stream.
virtual ~Stream()=default
Virtual destructor.
bool ReadArray(T *data, size_t num_elems)
Read an array of typed values element by element.
Definition io.h:118
virtual size_t Write(const void *ptr, size_t size)=0
Write raw bytes to the stream.
void Write(const T &data)
Write a typed value using Serializer<T>.
Definition io.h:84
bool Read(T *out_data)
Read a typed value using Serializer<T>.
Definition io.h:96
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition analyzer.h:40
Primary Serializer template. Specialize for each serializable type.
Definition io.h:42
static constexpr bool enabled
Definition io.h:43