/home/runner/work/LabNeura/LabNeura/src/labneura/backends/common/dtype_validation.h
Line | Count | Source (jump to first uncovered line) |
1 | | #pragma once |
2 | | |
3 | | #include "labneura/tensor.h" |
4 | | #include <stdexcept> |
5 | | |
6 | | namespace labneura { |
7 | | |
8 | 19.8k | inline void validate_tensor_dtype_supported(QuantizationMode mode) { |
9 | 19.8k | switch (mode) { |
10 | 7.63k | case QuantizationMode::FP32: |
11 | 11.8k | case QuantizationMode::FP16: |
12 | 14.4k | case QuantizationMode::INT16: |
13 | 18.6k | case QuantizationMode::INT8: |
14 | 19.8k | case QuantizationMode::BOOL: |
15 | 19.8k | return; |
16 | 0 | case QuantizationMode::FP64: |
17 | 0 | throw std::invalid_argument("Unsupported tensor dtype: FP64"); |
18 | 0 | case QuantizationMode::INT32: |
19 | 0 | throw std::invalid_argument("Unsupported tensor dtype: INT32"); |
20 | 0 | default: |
21 | 0 | throw std::invalid_argument("Unsupported tensor dtype: unknown"); |
22 | 19.8k | } |
23 | 19.8k | } |
24 | | |
25 | | } // namespace labneura |