|
Tannic
A C++ Tensor Library
|
Core type system for the Tannic Tensor Library. More...
#include <iostream>#include <cstdint>#include <string>#include <complex>#include "runtime/types.h"

Go to the source code of this file.
Namespaces | |
| namespace | tannic |
Functions | |
| constexpr std::size_t | tannic::dsizeof (type type) |
| Returns the size in bytes of a given tensor data type. | |
| constexpr std::size_t | tannic::nbytesof (type dtype, std::size_t nelements) |
Returns the total number of bytes required to store nelements elements of the given data type. | |
| constexpr std::string | tannic::dnameof (type type) |
| Returns the string name of a given tensor data type. | |
| constexpr uint8_t | tannic::dcodeof (type type) |
| Returns the numeric code used for serialization of a data type. | |
| constexpr type | tannic::dtypeof (uint8_t code) |
| Converts a numeric type code back to its corresponding type enum. | |
| template<typename T > | |
| constexpr type | tannic::dtypeof () |
| std::ostream & | tannic::operator<< (std::ostream &ostream, type type) |
Core type system for the Tannic Tensor Library.
Defines the fundamental data types supported by tensors and provides utilities for:
The type enum defines all supported numeric types:
dsizeof(type): Returns byte size of a typednameof(type): Returns string name of a typedcodeof(type): Returns numeric code for serializationdtypeof(code): Converts code back to type enumoperator<<: Stream output supportstd::cout << dnameof(float32); // "float32" std::cout << dsizeof(complex128); // 16