MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / exec

Method exec

dnn/src/x86/cvt_color/opr_impl.cpp:1919–1935  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1917}
1918
1919void 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

Callers 1

Calls 3

execFunction · 0.50
ifFunction · 0.50
paramMethod · 0.45

Tested by

no test coverage detected