| 21 | } |
| 22 | |
| 23 | void CPUPool::submitKernels(const Ref<CancellationToken>& ct) |
| 24 | { |
| 25 | if (!src || !dst) |
| 26 | throw std::logic_error("pooling source/destination not set"); |
| 27 | |
| 28 | const int blockC = getTensorLayoutInfo(dstDesc.layout).blockC; |
| 29 | |
| 30 | ispc::CPUPoolKernel kernel; |
| 31 | kernel.src = *src; |
| 32 | kernel.dst = *dst; |
| 33 | |
| 34 | auto kernelFunc = (src->getDataType() == DataType::Float16) |
| 35 | ? ispc::CPUPoolKernel_run_f16 |
| 36 | : ispc::CPUPoolKernel_run_f32; |
| 37 | |
| 38 | engine->submitFunc([=] |
| 39 | { |
| 40 | parallel_for(kernel.dst.C / blockC, kernel.dst.H, [&](int cb, int h) |
| 41 | { |
| 42 | kernelFunc(&kernel, cb, h); |
| 43 | }); |
| 44 | }, ct); |
| 45 | } |
| 46 | |
| 47 | OIDN_NAMESPACE_END |
nothing calls this directly
no test coverage detected