File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -362,6 +362,14 @@ function(torch_compile_options libname)
362
362
# For MS official doc: https://learn.microsoft.com/en-us/cpp/build/reference/zc-preprocessor
363
363
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:preprocessor" PARENT_SCOPE )
364
364
365
+ if (${MSVC_TOOLSET_VERSION} GREATER_EQUAL 143 )
366
+ # Add /d2implyavx512upperregs- to disable compiler over-aggressive optimization, which caused involeved AVX512 register on AVX2 machine.
367
+ # Reference: https://github.com/pytorch/pytorch/issues/145702#issuecomment-2874029459
368
+ target_compile_options (${libname} PUBLIC $< $< COMPILE_LANGUAGE:CXX> :/d2implyavx512upperregs-> )
369
+ endif ()
370
+
371
+
372
+
365
373
target_compile_options (${libname} PUBLIC
366
374
$< $< COMPILE_LANGUAGE:CXX> :
367
375
${MSVC_RUNTIME_LIBRARY_OPTION}
You can’t perform that action at this time.
0 commit comments