Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix variant compile error #42203

Merged
merged 1 commit into from Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions paddle/phi/kernels/cpu/where_grad_kernel.cc
Expand Up @@ -14,6 +14,8 @@

#include "paddle/phi/kernels/where_grad_kernel.h"

#include "paddle/phi/core/kernel_registry.h"

namespace phi {

template <typename T, typename Context>
Expand Down
2 changes: 2 additions & 0 deletions paddle/phi/kernels/cpu/where_kernel.cc
Expand Up @@ -14,6 +14,8 @@

#include "paddle/phi/kernels/where_kernel.h"

#include "paddle/phi/core/kernel_registry.h"

namespace phi {

template <typename T, typename Context>
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/kernels/funcs/activation_functor.h
Expand Up @@ -13,6 +13,7 @@
// limitations under the License.

#pragma once

#include <glog/logging.h>
#include <algorithm>
#include <memory>
Expand All @@ -33,7 +34,6 @@
#include "paddle/phi/common/float16.h"
#include "paddle/phi/core/dense_tensor.h"
#include "paddle/phi/core/enforce.h"
#include "paddle/phi/core/kernel_registry.h"
#include "paddle/phi/kernels/funcs/eigen/common.h"
#include "paddle/phi/kernels/funcs/eigen/extensions.h"

Expand Down
3 changes: 3 additions & 0 deletions paddle/phi/kernels/gpu/where_grad_kernel.cu
Expand Up @@ -14,6 +14,9 @@

#include "paddle/phi/kernels/where_grad_kernel.h"

#include "paddle/phi/backends/gpu/gpu_launch_config.h"
#include "paddle/phi/core/kernel_registry.h"

namespace phi {

template <typename T>
Expand Down
2 changes: 2 additions & 0 deletions paddle/phi/kernels/gpu/where_kernel.cu
Expand Up @@ -14,6 +14,8 @@

#include "paddle/phi/kernels/where_kernel.h"

#include "paddle/phi/backends/gpu/gpu_launch_config.h"
#include "paddle/phi/core/kernel_registry.h"
#include "paddle/phi/kernels/funcs/broadcast_function.h"
#include "paddle/phi/kernels/funcs/elementwise_functor.h"

Expand Down
3 changes: 0 additions & 3 deletions paddle/phi/kernels/where_grad_kernel.h
Expand Up @@ -14,10 +14,7 @@

#pragma once

#include "paddle/phi/backends/all_context.h"
#include "paddle/phi/backends/gpu/gpu_launch_config.h"
#include "paddle/phi/core/dense_tensor.h"
#include "paddle/phi/core/kernel_registry.h"

namespace phi {

Expand Down
3 changes: 0 additions & 3 deletions paddle/phi/kernels/where_kernel.h
Expand Up @@ -14,10 +14,7 @@

#pragma once

#include "paddle/phi/backends/all_context.h"
#include "paddle/phi/backends/gpu/gpu_launch_config.h"
#include "paddle/phi/core/dense_tensor.h"
#include "paddle/phi/core/kernel_registry.h"

namespace phi {

Expand Down
3 changes: 2 additions & 1 deletion paddle/utils/variant.h
Expand Up @@ -2691,7 +2691,8 @@ inline constexpr bool all(std::initializer_list<bool> bs) {

template <typename Visitor, typename... Vs>
inline constexpr decltype(auto) visit(Visitor &&visitor, Vs &&... vs) {
return (detail::all({!vs.valueless_by_exception()...})
return (detail::all(
lib::array<bool, sizeof...(Vs)>{!vs.valueless_by_exception()...})
? (void)0
: throw_bad_variant_access()),
detail::visitation::variant::visit_value(
Expand Down