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
8
namespace
continuum::ir
{
9
10
enum class
DType
: std::uint8_t {
F32
,
F16
,
BF16
,
I32
,
I64
,
U8
,
Bool
};
11
enum class
Device
: std::uint8_t {
CPU
,
CUDA
,
MPS
,
MLX
,
Remote
};
12
13
struct
TensorType
{
14
std::vector<std::int64_t>
shape
;
15
DType
dtype
=
DType::F32
;
16
Device
device
=
Device::CPU
;
17
};
18
19
struct
TokensType
{
20
std::string
vocab_id
;
21
std::int32_t
max_len
= 0;
22
std::string
model_family
;
23
};
24
25
struct
SchemaType
{
26
std::string
canonical_json
;
27
std::uint64_t
schema_hash
= 0;
28
};
29
30
struct
EffectType
{
31
std::uint8_t
bits
= 0;
32
};
33
34
using
Type
= std::variant<TensorType, TokensType, SchemaType, EffectType>;
35
36
bool
is_subtype
(
const
Type
& a,
const
Type
& b);
37
Type
meet
(
const
Type
& a,
const
Type
& b);
38
39
}
// namespace continuum::ir
continuum::ir
Definition
effect.hpp:5
continuum::ir::is_subtype
bool is_subtype(const Type &a, const Type &b)
continuum::ir::meet
Type meet(const Type &a, const Type &b)
continuum::ir::Device
Device
Definition
type.hpp:11
continuum::ir::Device::CPU
@ CPU
continuum::ir::Device::CUDA
@ CUDA
continuum::ir::Device::MLX
@ MLX
continuum::ir::Device::MPS
@ MPS
continuum::ir::Device::Remote
@ Remote
continuum::ir::DType
DType
Definition
type.hpp:10
continuum::ir::DType::F32
@ F32
continuum::ir::DType::F16
@ F16
continuum::ir::DType::U8
@ U8
continuum::ir::DType::Bool
@ Bool
continuum::ir::DType::I32
@ I32
continuum::ir::DType::I64
@ I64
continuum::ir::DType::BF16
@ BF16
continuum::ir::Type
std::variant< TensorType, TokensType, SchemaType, EffectType > Type
Definition
type.hpp:34
continuum::ir::EffectType
Definition
type.hpp:30
continuum::ir::EffectType::bits
std::uint8_t bits
Definition
type.hpp:31
continuum::ir::SchemaType
Definition
type.hpp:25
continuum::ir::SchemaType::canonical_json
std::string canonical_json
Definition
type.hpp:26
continuum::ir::SchemaType::schema_hash
std::uint64_t schema_hash
Definition
type.hpp:27
continuum::ir::TensorType
Definition
type.hpp:13
continuum::ir::TensorType::dtype
DType dtype
Definition
type.hpp:15
continuum::ir::TensorType::device
Device device
Definition
type.hpp:16
continuum::ir::TensorType::shape
std::vector< std::int64_t > shape
Definition
type.hpp:14
continuum::ir::TokensType
Definition
type.hpp:19
continuum::ir::TokensType::model_family
std::string model_family
Definition
type.hpp:22
continuum::ir::TokensType::max_len
std::int32_t max_len
Definition
type.hpp:21
continuum::ir::TokensType::vocab_id
std::string vocab_id
Definition
type.hpp:20
include
continuum
ir
type.hpp
Generated by
1.9.8