!19318 fix some models run gpu_cl fail in galaxys9

Merge pull request !19318 from yeyunpeng2020/gpu
This commit is contained in:
i-robot 2021-07-03 06:29:44 +00:00 committed by Gitee
commit 11b6b6b5a5
1 changed files with 7 additions and 1 deletions

View File

@ -62,7 +62,7 @@ int OpenCLExecutor::RunOrTune(const std::vector<Tensor *> &inputs, const std::ve
if (zero_shape_num != kernel->out_tensors().size()) {
if (is_tune) {
ret = op_kernel->PreProcess();
if (RET_OK != ret) {
if (ret != RET_OK) {
MS_LOG(WARNING) << "PreProcess kernel failed, name: " << kernel->name() << " in tuning";
opencl_runtime_ins->SetProfiling(profiling_tmp);
return RET_OK;
@ -72,6 +72,12 @@ int OpenCLExecutor::RunOrTune(const std::vector<Tensor *> &inputs, const std::ve
MS_LOG(ERROR) << "tuning kernel failed, name: " << kernel->name();
return ret;
}
ret = op_kernel->PostProcess();
if (ret != RET_OK) {
MS_LOG(WARNING) << "PostProcess kernel failed, name: " << kernel->name() << " in tuning";
opencl_runtime_ins->SetProfiling(profiling_tmp);
return RET_OK;
}
} else {
ret = kernel->Execute();
if (ret != RET_OK) {