mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
[ROCm][Windows] Fix clang-cl error related to -Wmissing prototypes enabled (#146981)
Some of the windows files (fused_kernels.cpp or temp_file.h) contain code that fail to compile when this flag is enabled when built with clang-cl. This PR resolves the issue by ensuring that even if we build with clang-cl, it doesn't include those flags on windows. Alternatively if needed, I can fix the files mentioned to pass under this flag. Pull Request resolved: https://github.com/pytorch/pytorch/pull/146981 Approved by: https://github.com/cyyever, https://github.com/Skylion007
This commit is contained in:
parent
49e8f9c965
commit
d9cf1debf9
|
|
@ -56,7 +56,7 @@ static bool programExists(const std::string& program) {
|
|||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
std::optional<std::wstring> exec(const std::wstring& cmd) {
|
||||
static std::optional<std::wstring> exec(const std::wstring& cmd) {
|
||||
std::array<wchar_t, 128> buffer;
|
||||
std::wstring result;
|
||||
std::unique_ptr<FILE, decltype(&_pclose)> pipe(
|
||||
|
|
@ -76,7 +76,7 @@ inline std::wstring& rtrim(std::wstring& s, const wchar_t* t = L" \t\n\r\f\v") {
|
|||
return s;
|
||||
}
|
||||
|
||||
void activate() {
|
||||
static void activate() {
|
||||
wchar_t* root = nullptr;
|
||||
std::wstring cmd;
|
||||
std::optional<std::wstring> exec_out;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
namespace torch::jit::fuser::cpu {
|
||||
|
||||
#ifdef _MSC_VER
|
||||
int wmkstemps(wchar_t* tmpl, int suffix_len) {
|
||||
inline int wmkstemps(wchar_t* tmpl, int suffix_len) {
|
||||
int len;
|
||||
wchar_t* name;
|
||||
int fd = -1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user