Continuum C++ API
Unified runtime for token + tensor execution
Loading...
Searching...
No Matches
type.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <string>
5#include <variant>
6#include <vector>
7
8namespace continuum::ir {
9
10enum class DType : std::uint8_t { F32, F16, BF16, I32, I64, U8, Bool };
11enum class Device : std::uint8_t { CPU, CUDA, MPS, MLX, Remote };
12
13struct TensorType {
14 std::vector<std::int64_t> shape;
17};
18
19struct TokensType {
20 std::string vocab_id;
21 std::int32_t max_len = 0;
22 std::string model_family;
23};
24
25struct SchemaType {
26 std::string canonical_json;
27 std::uint64_t schema_hash = 0;
28};
29
30struct EffectType {
31 std::uint8_t bits = 0;
32};
33
34using Type = std::variant<TensorType, TokensType, SchemaType, EffectType>;
35
36bool is_subtype(const Type& a, const Type& b);
37Type meet(const Type& a, const Type& b);
38
39} // namespace continuum::ir
Definition effect.hpp:5
bool is_subtype(const Type &a, const Type &b)
Type meet(const Type &a, const Type &b)
Device
Definition type.hpp:11
DType
Definition type.hpp:10
std::variant< TensorType, TokensType, SchemaType, EffectType > Type
Definition type.hpp:34
Definition type.hpp:30
std::uint8_t bits
Definition type.hpp:31
Definition type.hpp:25
std::string canonical_json
Definition type.hpp:26
std::uint64_t schema_hash
Definition type.hpp:27
Definition type.hpp:13
DType dtype
Definition type.hpp:15
Device device
Definition type.hpp:16
std::vector< std::int64_t > shape
Definition type.hpp:14
Definition type.hpp:19
std::string model_family
Definition type.hpp:22
std::int32_t max_len
Definition type.hpp:21
std::string vocab_id
Definition type.hpp:20