triton-lang / triton

Development repository for the Triton language and compiler
https://triton-lang.org/
MIT License
13.47k stars 1.66k forks source link

Windows related changes in `CMakeLists.txt` #5186

Open anmyachev opened 3 days ago

anmyachev commented 3 days ago

Upstreaming some of our Windows related changes assuming that there is interest in this https://github.com/triton-lang/triton/issues/5094#issuecomment-2462747885 and hoping that it will not make it much more difficult to support this CMake file.

anmyachev commented 2 days ago

@peterbell10 thanks for review! Ready for another round.

If I remember correctly we tried to compile the code and -std=gnu++17 flag was not needed. Could it be that this is just an artifact of the past and I can try to remove it? Or would you prefer to leave it anyway?

peterbell10 commented 2 days ago

If it's not needed then I'd be fine with removing it. I guess #4976 removed the only use of builtins?

woct0rdho commented 2 days ago

I just want to say that if we remove -std=gnu++17 and allow to use C++20, it would be much easier to build on Windows using MSVC (MSVC is usually needed to build with CUDA), because some namespace resolution behaviors in code like lib/Analysis/Utility.cpp become standard

anmyachev commented 2 days ago

If it's not needed then I'd be fine with removing it. I guess #4976 removed the only use of builtins?

There is at least one more biltins here: https://github.com/triton-lang/triton/blob/54c840b06443fd28357d81acb605ef16ba4e4e1a/lib/Tools/LinearLayout.cpp#L481 Hm, it shouldn't work with c++17 only. Looks like set(CMAKE_CXX_STANDARD 17) for GCC implicitly use -std=gnu++17.

anmyachev commented 1 day ago

I just want to say that if we remove -std=gnu++17 and allow to use C++20

@woct0rdho I'm looking forward to this event, but it's unlikely to happen before PyTorch switches to the new standard (at least that's my current understanding)

@peterbell10 I was wrong about -std=gnu++17 but it doesn't relate to this PR. Could you review it again?