[CI]【Hackathon 10th Spring No.46】Windows C++ compilation guards (1/3)#7327
Open
r-cloudforge wants to merge 12 commits intoPaddlePaddle:developfrom
Open
[CI]【Hackathon 10th Spring No.46】Windows C++ compilation guards (1/3)#7327r-cloudforge wants to merge 12 commits intoPaddlePaddle:developfrom
r-cloudforge wants to merge 12 commits intoPaddlePaddle:developfrom
Conversation
added 12 commits
March 6, 2026 10:30
|
cloudforge1 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
Thanks for your contribution! |
fastdeploy-bot
left a comment
There was a problem hiding this comment.
🤖 AI Code Review | 2026-04-11 04:00 CST
📋 Review 摘要
PR 概述:为 FastDeploy 添加 Windows C++ 编译兼容性支持(Hackathon 10th Spring No.46 Part 1)
变更范围:custom_ops/gpu_ops/ 目录下的 28 个文件
影响面 Tag:[CI]
📝 PR 规范检查
PR 标题和描述均符合规范,无需修改。
问题
未发现阻塞性问题。
总体评价
本次 PR 作为 Windows 构建支持的第一阶段,正确地通过 #ifndef _WIN32 / #endif 保护了 POSIX-only 的 C++ 头文件,并使用 #ifdef _WIN32 + PD_THROW 对依赖 POSIX IPC/共享内存的函数进行了 Windows 平台隔离。env.h 中添加的 #include <cstdlib> 和 #include <string> 正确解决了 MSVC 14.44 的兼容性问题。所有修改均为平台隔离代码,零功能性变更,不影响 Linux 平台。CI 已通过,代码质量良好。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
FastDeploy's
custom_ops/gpu_ops/C++ source files include POSIX-only headers(
<sys/mman.h>,<sys/ipc.h>,<sys/shm.h>,<sys/msg.h>,<unistd.h>) thatare unavailable on MSVC, preventing compilation on Windows.
Additionally,
env.hrelies onstd::stoi,std::stoul, andstd::stringwithout explicitly including
<cstdlib>and<string>. GCC's<iostream>transitively provides these, but MSVC 14.44 does not.
This is Part 1 of 3 for 【Hackathon 10th Spring No.46】(Windows Build Support):
#ifndef _WIN32guards on POSIX-only includes +env.hportability fixsetup_ops.pyplatform-conditional link args +build.bat/dev/shm,os.killpg,os.setsid,forkModifications
#ifndef _WIN32/#endifguards around POSIX-only includes in 26.cu/.cc/.hfiles#include <cstdlib>and#include <string>toenv.hfor MSVC portabilityclang-formatto all touched filesFiles changed: 27 (26 guard additions + 1 include fix)
All guards are
_WIN32-only — zero functional change on Linux.Usage or Command
On Windows with MSVC + CUDA toolkit:
Accuracy Tests
Not applicable — pure preprocessor changes. No functional code modified.
Verified via MSVC 14.44 (VS 2022 Build Tools) preprocess test on Windows Server 2022:
all 27 modified headers parse cleanly with
cl.exe /E.Pipeline Evidence:
Checklist
#ifndef _WIN32guards only wrap POSIX-specific includesclang-formatapplied to all touched filespre-commithooks pass