tvm
Loading...
Searching...
No Matches
Classes | Functions
tvm::support Namespace Reference

Classes

class  BytesInStream
 Read-only stream over a fixed memory region. More...
 
class  BytesOutStream
 Write-only stream that appends to a caller-provided std::string. More...
 
struct  GPUThreadTag
 The rank and dimension of a physical GPU thread tag. More...
 
class  OrderedMap
 An STL-like map that preserves insertion order. More...
 
struct  Serializer
 Primary Serializer template. Specialize for each serializable type. More...
 
struct  Serializer< DLDataType >
 
struct  Serializer< DLDevice >
 
struct  Serializer< ffi::Array< T > >
 
struct  Serializer< ffi::Bytes >
 
struct  Serializer< ffi::Map< K, V > >
 
struct  Serializer< ffi::String >
 
struct  Serializer< std::pair< A, B > >
 
struct  Serializer< std::string >
 
struct  Serializer< std::unordered_map< K, V > >
 
struct  Serializer< std::vector< T > >
 
struct  Serializer< T, std::enable_if_t< std::is_arithmetic_v< T > > >
 
struct  Serializer< T, std::enable_if_t< std::is_enum_v< T > > >
 
class  Stream
 Abstract binary stream for serialization. More...
 

Functions

template<typename T >
T GetEnv (const char *key, T default_value)
 Get environment variable with a typed default value.
 
ffi::String GetFileFormat (const ffi::String &path, const ffi::String &format)
 Get the explicit format, or the extension of the file path.
 
ffi::Bytes ReadBytesFromFile (const ffi::String &path)
 Read a file as binary bytes.
 
void WriteBytesToFile (const ffi::String &path, const ffi::Bytes &data)
 Write binary bytes to a file.
 

Function Documentation

◆ GetEnv()

template<typename T >
T tvm::support::GetEnv ( const char *  key,
T  default_value 
)
inline

Get environment variable with a typed default value.

Template Parameters
TThe value type (must be arithmetic or std::string).
Parameters
keyThe environment variable name.
default_valueThe value to return if the variable is unset or empty.
Returns
The parsed value or the default.

◆ GetFileFormat()

ffi::String tvm::support::GetFileFormat ( const ffi::String &  path,
const ffi::String &  format 
)
inline

Get the explicit format, or the extension of the file path.

◆ ReadBytesFromFile()

ffi::Bytes tvm::support::ReadBytesFromFile ( const ffi::String &  path)
inline

Read a file as binary bytes.

◆ WriteBytesToFile()

void tvm::support::WriteBytesToFile ( const ffi::String &  path,
const ffi::Bytes &  data 
)
inline

Write binary bytes to a file.