未验证 提交 42ca5d61 编写于 作者: L limingshu 提交者: GitHub

[cherry-pick]fix windows static_assert error (#53694)

Fix static_assert bug in Windows CUDA 11.6 compilation. This may be the bug of msvc.
上级 73e6bbba
......@@ -535,8 +535,10 @@ void ComputeFusedGemmEpilogueBackwardImpl(const phi::GPUContext& dev_ctx,
bool use_addto_dx,
bool use_addto_dy) {
using MT = typename phi::dtype::MPTypeTrait<T>::Type;
static_assert(std::is_same<DXT, T>::value || std::is_same<DXT, MT>::value);
static_assert(std::is_same<DYT, T>::value || std::is_same<DYT, MT>::value);
constexpr bool kIsValidDataType =
(std::is_same<DXT, T>::value || std::is_same<DXT, MT>::value) &&
(std::is_same<DYT, T>::value || std::is_same<DYT, MT>::value);
static_assert(kIsValidDataType, "Invalid data type");
using Trait = FusedGEMMGradTrait<TransX, TransY>;
if (dx) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册