34 Stage* stage =
nullptr;
46 s->deserializeHeader(config, config_size);
50 s->deserializeHeader(config, config_size);
53 throw std::runtime_error(
54 "Unsupported Lorenzo template instantiation: input_type="
55 + std::to_string(
static_cast<int>(lc.
input_type))
56 +
" code_type=" + std::to_string(
static_cast<int>(lc.
code_type)));
59 throw std::runtime_error(
"Lorenzo config too small: " + std::to_string(config_size));
67 if (config_size >= 2) {
71 if (tin_dt == DataType::INT8 && tout_dt == DataType::UINT8)
73 else if (tin_dt == DataType::INT16 && tout_dt == DataType::UINT16)
75 else if (tin_dt == DataType::INT32 && tout_dt == DataType::UINT32)
77 else if (tin_dt == DataType::INT64 && tout_dt == DataType::UINT64)
88 throw std::runtime_error(
"Unsupported Difference data type: "
89 + std::to_string(
static_cast<int>(tin_dt)));
91 }
else if (config_size >= 1) {
103 throw std::runtime_error(
"Unsupported Difference data type: "
104 + std::to_string(
static_cast<int>(dt)));
113 if (config_size >= 1) {
115 std::memcpy(&dt, config,
sizeof(
DataType));
122 throw std::runtime_error(
"Unsupported RLE data type: "
123 + std::to_string(
static_cast<int>(dt)));
134 if (config_size >= 2) {
137 if (tin_dt == DataType::INT8 && tout_dt == DataType::UINT8)
139 else if (tin_dt == DataType::INT16 && tout_dt == DataType::UINT16)
141 else if (tin_dt == DataType::INT32 && tout_dt == DataType::UINT32)
143 else if (tin_dt == DataType::INT64 && tout_dt == DataType::UINT64)
146 throw std::runtime_error(
147 "Unsupported ZigzagStage type pair: TIn="
148 + std::to_string(
static_cast<int>(tin_dt))
149 +
" TOut=" + std::to_string(
static_cast<int>(tout_dt)));
159 if (config_size >= 2) {
162 if (tin_dt == DataType::INT8 && tout_dt == DataType::UINT8)
164 else if (tin_dt == DataType::INT16 && tout_dt == DataType::UINT16)
166 else if (tin_dt == DataType::INT32 && tout_dt == DataType::UINT32)
168 else if (tin_dt == DataType::INT64 && tout_dt == DataType::UINT64)
171 throw std::runtime_error(
172 "Unsupported NegabinaryStage type pair: TIn="
173 + std::to_string(
static_cast<int>(tin_dt))
174 +
" TOut=" + std::to_string(
static_cast<int>(tout_dt)));
184 s->deserializeHeader(config, config_size);
191 s->deserializeHeader(config, config_size);
197 throw std::runtime_error(
"Unknown stage type: "
198 + std::to_string(
static_cast<uint16_t
>(type)));
Stage * createStage(StageType type, const uint8_t *config, size_t config_size)
Definition stage_factory.h:33