Skip to content

Commit d9cf1de

Browse files
m-galluspytorchmergebot
authored andcommitted
[ROCm][Windows] Fix clang-cl error related to -Wmissing prototypes enabled (pytorch#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: pytorch#146981 Approved by: https://github.com/cyyever, https://github.com/Skylion007
1 parent 49e8f9c commit d9cf1de

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

torch/csrc/jit/codegen/fuser/cpu/fused_kernel.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static bool programExists(const std::string& program) {
5656
}
5757

5858
#ifdef _MSC_VER
59-
std::optional<std::wstring> exec(const std::wstring& cmd) {
59+
static std::optional<std::wstring> exec(const std::wstring& cmd) {
6060
std::array<wchar_t, 128> buffer;
6161
std::wstring result;
6262
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") {
7676
return s;
7777
}
7878

79-
void activate() {
79+
static void activate() {
8080
wchar_t* root = nullptr;
8181
std::wstring cmd;
8282
std::optional<std::wstring> exec_out;

torch/csrc/jit/codegen/fuser/cpu/temp_file.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
namespace torch::jit::fuser::cpu {
2626

2727
#ifdef _MSC_VER
28-
int wmkstemps(wchar_t* tmpl, int suffix_len) {
28+
inline int wmkstemps(wchar_t* tmpl, int suffix_len) {
2929
int len;
3030
wchar_t* name;
3131
int fd = -1;

0 commit comments

Comments
 (0)