From 4dc28b54346e608858793ebcdaebd3ab70b77354 Mon Sep 17 00:00:00 2001 From: limingshu <61349199+JamesLim-sy@users.noreply.github.com> Date: Fri, 19 May 2023 15:16:30 +0800 Subject: [PATCH] fix_windows_static_assert_error (#53750) --- paddle/phi/kernels/funcs/fused_gemm_epilogue.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/paddle/phi/kernels/funcs/fused_gemm_epilogue.h b/paddle/phi/kernels/funcs/fused_gemm_epilogue.h index 8a2309ba260..ab0758e2e3f 100644 --- a/paddle/phi/kernels/funcs/fused_gemm_epilogue.h +++ b/paddle/phi/kernels/funcs/fused_gemm_epilogue.h @@ -535,10 +535,11 @@ void ComputeFusedGemmEpilogueBackwardImpl(const phi::GPUContext& dev_ctx, bool use_addto_dx, bool use_addto_dy) { using MT = typename phi::dtype::MPTypeTrait::Type; - static_assert(std::is_same::value || std::is_same::value, - ""); - static_assert(std::is_same::value || std::is_same::value, - ""); + constexpr bool kIsValidDataType = + (std::is_same::value || std::is_same::value) && + (std::is_same::value || std::is_same::value); + static_assert(kIsValidDataType, "Invalid data type"); + using Trait = FusedGEMMGradTrait; if (dx) { -- GitLab