| 53 | } |
| 54 | |
| 55 | CPUConvAMX::CPUConvAMX(CPUEngine* engine, const ConvDesc& desc) |
| 56 | : Conv(desc), |
| 57 | engine(engine) |
| 58 | { |
| 59 | if (srcDesc.layout != TensorLayout::Chw32c || srcDesc.dataType != DataType::Float16) |
| 60 | throw std::invalid_argument("unsupported convolution source layout/data type"); |
| 61 | if (weightDesc.getW() != 3 || weightDesc.getH() != 3) |
| 62 | throw std::invalid_argument("unsupported convolution kernel size"); |
| 63 | if (weightDesc.layout != TensorLayout::OIhw2o16i16o2i || weightDesc.dataType != DataType::Float16) |
| 64 | throw std::invalid_argument("unsupported convolution weight layout/data type"); |
| 65 | if (biasDesc.layout != TensorLayout::x || biasDesc.dataType != DataType::Float16) |
| 66 | throw std::invalid_argument("unsupported convolution bias layout/data type"); |
| 67 | } |
| 68 | |
| 69 | void CPUConvAMX::submitKernels(const Ref<CancellationToken>& ct) |
| 70 | { |