From 26c44a86f85194c5fb2fe6fc52db2e2f149ffbf5 Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Fri, 10 Dec 2021 11:06:44 +0800 Subject: [PATCH] revert flags_benchmark (#38005) --- paddle/fluid/imperative/prepared_operator.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/paddle/fluid/imperative/prepared_operator.cc b/paddle/fluid/imperative/prepared_operator.cc index 8875ef74bc..54f46e49c4 100644 --- a/paddle/fluid/imperative/prepared_operator.cc +++ b/paddle/fluid/imperative/prepared_operator.cc @@ -487,6 +487,14 @@ static void PreparedOpRunImpl( op.Type(), outs, dev_ctx->GetPlace()); } + if (FLAGS_benchmark) { + dev_ctx->Wait(); +#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) + PADDLE_ENFORCE_GPU_SUCCESS(platform::GpuGetLastError()); + VLOG(4) << "Operator(" << op.Type() << "): context wait and get last error"; +#endif + } + /** * [ Why need handle complex gradient to real gradient? ] * -- GitLab