Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesLim-sy committed Jul 7, 2022
1 parent bbe9955 commit 5c9aaf7
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions paddle/phi/kernels/autotune/auto_tune_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,20 +153,15 @@ template <typename T, typename KernelType>
class TransposeAutoTuner : public AutoTuneBase<T, KernelType> {
public:
static AutoTuneBase<T, KernelType>* Instance(KernelType kernel) {
static std::once_flag transpose_init_flag_;
static std::unique_ptr<AutoTuneBase<T, KernelType>> instance_;
std::call_once(init_flag_, [&] {
std::call_once(transpose_init_flag_, [&] {
instance_.reset(new AutoTuneBase<T, KernelType>(kernel));
});
return instance_.get();
}

private:
static std::once_flag init_flag_;
};

template <typename T, typename KernelType>
std::once_flag TransposeAutoTuner<T, KernelType>::init_flag_;

template <typename T, typename RetureType, typename... Args>
static AutoTuneBase<T, KernelCallback<T, RetureType, Args...>>*
MakeTransposeTuner(RetureType (*func)(Args...)) {
Expand Down

1 comment on commit 5c9aaf7

@paddle-bot-old
Copy link

@paddle-bot-old paddle-bot-old bot commented on 5c9aaf7 Jul 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵️ CI failures summary

🔍 PR: #44141 Commit ID: 5c9aaf7 contains failed CI.

🔹 Failed: PR-CI-Coverage

Unknown Failed
Unknown Failed

Please sign in to comment.