!35926 enable graph kernel for pynative

Merge pull request !35926 from chujinjin/enable_graph_kernel_for_pynative
This commit is contained in:
i-robot 2022-06-15 01:28:43 +00:00 committed by Gitee
commit ebc32c0f46
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 1 additions and 6 deletions

View File

@ -193,14 +193,9 @@ std::pair<std::string, bool> GraphKernelFlags::GetGraphKernelContext() {
void GraphKernelFlags::CheckSupport() const {
#ifndef MSLITE_ENABLE_GRAPH_KERNEL
if (IsEnableGraphKernel()) {
#ifndef USE_LLVM
auto context = MsContext::GetInstance();
MS_EXCEPTION_IF_NULL(context);
if (context->get_param<int>(MS_CTX_EXECUTION_MODE) != kGraphMode) {
MS_LOG(WARNING) << "Graph Kernel Fusion only supports GRAPH_MODE, and it will be turned off now.";
const_cast<GraphKernelFlags *>(this)->opt_level = OptLevel_0;
return;
}
#ifndef USE_LLVM
auto is_cpu = (context->get_param<std::string>(MS_CTX_DEVICE_TARGET) == kCPUDevice);
if (is_cpu) {
MS_LOG(WARNING)