| 1917 | } |
| 1918 | |
| 1919 | void CvtColorImpl::exec( |
| 1920 | _megdnn_tensor_in src, _megdnn_tensor_out dst, _megdnn_workspace workspace) { |
| 1921 | using namespace megcv; |
| 1922 | check_exec(src.layout, dst.layout, workspace.size); |
| 1923 | // x86 cvt_color implementation need sse4.2 |
| 1924 | if (!is_supported(SIMDType::SSE4_2)) { |
| 1925 | naive::CvtColorImpl::exec(src, dst, workspace); |
| 1926 | return; |
| 1927 | } |
| 1928 | auto mode = this->param().mode; |
| 1929 | MEGDNN_DISPATCH_CPU_KERN_OPR( |
| 1930 | if (dst.layout.dtype == dtype::Float32()) { |
| 1931 | cvt_color_exec<float>(src, dst, mode); |
| 1932 | } else if (dst.layout.dtype == dtype::Uint8()) { |
| 1933 | cvt_color_exec<uchar>(src, dst, mode); |
| 1934 | } else { megdnn_throw("Unsupported datatype of CvtColor optr."); }); |
| 1935 | } |
| 1936 | |
| 1937 | } // namespace x86 |
| 1938 | } // namespace megdnn |
no test coverage detected