Skip to content

Conversation

@Manfredss
Copy link
Contributor

@Manfredss Manfredss commented Nov 3, 2025

PR Category

Environment Adaptation

PR Types

Bug fixes

Description

fix compile error in paddle/phi/core/framework/data_type_transform.cc

before:

 template <typename InType, typename OutType>
 struct CastDataTypeFunctor {
   HOSTDEVICE inline OutType operator()(InType in) const {
     return static_cast<OutType>(in);
  }
};

after:

template <typename InType, typename OutType>
struct CastDataTypeFunctor {
  HOSTDEVICE inline OutType operator()(InType in) const {
    #if defined(_MSC_VER)
        // Avoid unsupported convert of float/bfloat8/float16 -> complex for MSVC
        if constexpr (
            (std::is_same_v<OutType, phi::dtype::complex<float>> ||
            std::is_same_v<OutType, phi::dtype::complex<double>>) &&
            (std::is_same_v<InType, phi::dtype::float8_e4m3fn> ||
            std::is_same_v<InType, phi::dtype::float8_e5m2> ||
            std::is_same_v<InType, phi::dtype::bfloat16> ||
            std::is_same_v<InType, phi::dtype::float16>)) {
          return OutType(0);  // default return value,only to avoid compile error
        } else
    #endif
        {
          return static_cast<OutType>(in);
        }
      }
};

@paddle-bot
Copy link

paddle-bot bot commented Nov 3, 2025

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added the contributor External developers label Nov 3, 2025
@Manfredss
Copy link
Contributor Author

Manfredss commented Nov 3, 2025

#76171 提交的 branch 上有太多历史 commit 没有解决,决定单独重开一个 PR
#76161 的 bug 修复

@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Nov 4, 2025
@luotao1 luotao1 self-assigned this Nov 4, 2025
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@b9e19ab). Learn more about missing BASE report.

Additional details and impacted files
@@             Coverage Diff             @@
##             develop    #76185   +/-   ##
===========================================
  Coverage           ?   100.00%           
===========================================
  Files              ?         1           
  Lines              ?         1           
  Branches           ?         0           
===========================================
  Hits               ?         1           
  Misses             ?         0           
  Partials           ?         0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@swgu98 swgu98 merged commit 8f44ad1 into PaddlePaddle:develop Nov 5, 2025
54 checks passed
@luotao1
Copy link
Contributor

luotao1 commented Nov 6, 2025

hi, @Manfredss

  • 非常感谢你对飞桨的贡献,我们正在运营一个PFCC组织。PFCC是飞桨开源的贡献者俱乐部,只有给飞桨合入过代码的开发者才能加入,俱乐部里每两周会有一次例会(按兴趣参加),也会时不时办线下meetup面基,详情可见 https://github.com/luotao1 主页说明。
  • 如果你对PFCC有兴趣,请发送邮件至 [email protected],我们会邀请你加入~

AlAuAu pushed a commit to AlAuAu/Paddle that referenced this pull request Nov 6, 2025
…InType' to 'OutType' (PaddlePaddle#76185)

* fix error C2440 when running ninja on windows

* fix pre-commit codestyle issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers HappyOpenSource 快乐开源活动issue与PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants