| 284 | |
| 285 | template<typename B, typename Q> |
| 286 | module::Decoder_SIHO<B, Q>* |
| 287 | Decoder_polar ::build(const std::vector<bool>& frozen_bits, |
| 288 | const module::CRC<B>* crc, |
| 289 | module::Encoder<B>* encoder) const |
| 290 | { |
| 291 | try |
| 292 | { |
| 293 | return Decoder::build<B, Q>(encoder); |
| 294 | } |
| 295 | catch (spu::tools::cannot_allocate const&) |
| 296 | { |
| 297 | if (this->type.find("SCL") != std::string::npos && this->implem == "FAST") |
| 298 | { |
| 299 | if (this->simd_strategy == "INTRA") |
| 300 | { |
| 301 | if (typeid(B) == typeid(signed char)) |
| 302 | { |
| 303 | return _build_scl_fast<B, Q, tools::API_polar_dynamic_intra<B, Q>>(frozen_bits, crc, encoder); |
| 304 | } |
| 305 | else if (typeid(B) == typeid(short)) |
| 306 | { |
| 307 | return _build_scl_fast<B, Q, tools::API_polar_dynamic_intra<B, Q>>(frozen_bits, crc, encoder); |
| 308 | } |
| 309 | else if (typeid(B) == typeid(int)) |
| 310 | { |
| 311 | return _build_scl_fast<B, Q, tools::API_polar_dynamic_intra<B, Q>>(frozen_bits, crc, encoder); |
| 312 | } |
| 313 | } |
| 314 | else if (this->simd_strategy.empty()) |
| 315 | { |
| 316 | return _build_scl_fast<B, Q, tools::API_polar_dynamic_seq<B, Q>>(frozen_bits, crc, encoder); |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | if (this->simd_strategy == "INTER" && this->type == "SC" && this->implem == "FAST") |
| 321 | { |
| 322 | if (typeid(B) == typeid(signed char)) |
| 323 | { |
| 324 | #ifdef AFF3CT_POLAR_BIT_PACKING |
| 325 | #ifdef API_POLAR_DYNAMIC |
| 326 | using API_polar = tools::API_polar_dynamic_inter_8bit_bitpacking<B, Q>; |
| 327 | #else |
| 328 | using API_polar = tools::API_polar_static_inter_8bit_bitpacking<B, Q>; |
| 329 | #endif |
| 330 | #else |
| 331 | #ifdef API_POLAR_DYNAMIC |
| 332 | using API_polar = tools::API_polar_dynamic_inter<B, Q>; |
| 333 | #else |
| 334 | using API_polar = tools::API_polar_static_inter<B, Q>; |
| 335 | #endif |
| 336 | #endif |
| 337 | return _build<B, Q, API_polar>(frozen_bits, crc, encoder); |
| 338 | } |
| 339 | else |
| 340 | { |
| 341 | #ifdef API_POLAR_DYNAMIC |
| 342 | using API_polar = tools::API_polar_dynamic_inter<B, Q>; |
| 343 | #else |
nothing calls this directly
no outgoing calls
no test coverage detected