!17462 fix opencl tuning

From: @yeyunpeng2020
Reviewed-by: @ddwsky,@ddwsky,@hangangqiang
Signed-off-by: @ddwsky,@ddwsky
This commit is contained in:
mindspore-ci-bot 2021-06-02 10:09:48 +08:00 committed by Gitee
commit e11e2ecaac
1 changed files with 6 additions and 0 deletions

View File

@ -62,6 +62,12 @@ 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) {
MS_LOG(WARNING) << "PreProcess kernel failed, name: " << kernel->name() << " in tuning";
opencl_runtime_ins->SetProfiling(profiling_tmp);
return RET_OK;
}
ret = op_kernel->Tune();
if (ret != RET_OK) {
MS_LOG(ERROR) << "tuning kernel failed, name: " << kernel->name();