MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / HasStructuredKernel

Method HasStructuredKernel

paddle/phi/core/kernel_factory.cc:71–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71bool KernelFactory::HasStructuredKernel(const std::string& op_type) const {
72 auto phi_kernel_name = phi::OpUtilsMap::Instance().GetBaseKernelName(op_type);
73 auto kernel_iter = kernels_.find(phi_kernel_name);
74 if (kernel_iter != kernels_.end()) {
75 return std::any_of(kernel_iter->second.begin(),
76 kernel_iter->second.end(),
77 [](phi::KernelKeyMap::const_reference kernel_pair) {
78 return kernel_pair.second.GetKernelRegisteredType() ==
79 KernelRegisteredType::STRUCTURE;
80 });
81 }
82 return false;
83}
84
85const Kernel& KernelFactory::SelectKernel(const std::string& kernel_name,
86 const KernelKey& kernel_key) const {

Callers 4

RunImplMethod · 0.80
ChoosePhiKernelMethod · 0.80
PrepareImplFunction · 0.80

Calls 5

InstanceFunction · 0.85
findMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected