File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515cmake_minimum_required (VERSION 3.28 )
1616project (qsim)
1717
18- IF (WIN32 )
19- add_compile_options (/arch:AVX2 /O2 /openmp )
20- ELSE ()
18+ if (WIN32 )
19+ add_compile_options (/arch:AVX2 /openmp )
20+ # Only apply /O2 if the configuration is RELEASE.
21+ # This prevents a conflict with /RTC1 in DEBUG builds.
22+ add_compile_options ($<$<CONFIG :RELEASE >:/O2 >
23+ else ()
2124 add_compile_options (-mavx2 -mfma -O3 -flto=auto )
22- ENDIF ()
25+ endif ()
2326
2427if (APPLE )
2528 include_directories (
@@ -36,7 +39,7 @@ if(APPLE)
3639 )
3740endif ()
3841
39- INCLUDE (../GetPybind11.cmake )
42+ include (../GetPybind11.cmake )
4043pybind11_add_module (qsim_avx2 pybind_main_avx2.cpp )
4144
4245target_link_libraries (qsim_avx2 PUBLIC OpenMP::OpenMP_CXX )
Original file line number Diff line number Diff line change 1515cmake_minimum_required (VERSION 3.28 )
1616project (qsim)
1717
18- IF (WIN32 )
19- add_compile_options (/arch:AVX512 /O2 /openmp )
20- ELSE ()
18+ if (WIN32 )
19+ add_compile_options (/arch:AVX512 /openmp )
20+ # Only apply /O2 if the configuration is RELEASE.
21+ # This prevents a conflict with /RTC1 in DEBUG builds.
22+ add_compile_options ($<$<CONFIG :RELEASE >:/O2 >
23+ else ()
2124 add_compile_options (-mavx512f -mbmi2 -O3 -flto=auto )
22- ENDIF ()
25+ endif ()
2326
2427if (APPLE )
2528 include_directories (
@@ -36,7 +39,7 @@ if(APPLE)
3639 )
3740endif ()
3841
39- INCLUDE (../GetPybind11.cmake )
42+ include (../GetPybind11.cmake )
4043pybind11_add_module (qsim_avx512 pybind_main_avx512.cpp )
4144
4245target_link_libraries (qsim_avx512 PUBLIC OpenMP::OpenMP_CXX )
Original file line number Diff line number Diff line change @@ -16,7 +16,10 @@ cmake_minimum_required(VERSION 3.28)
1616project (qsim)
1717
1818if (WIN32 )
19- add_compile_options (/O2 /openmp )
19+ add_compile_options (/openmp )
20+ # Only apply /O2 if the configuration is RELEASE.
21+ # This prevents a conflict with /RTC1 in DEBUG builds.
22+ add_compile_options ($<$<CONFIG :RELEASE >:/O2 >
2023else ()
2124 add_compile_options (-O3 -flto=auto )
2225endif ()
@@ -36,7 +39,7 @@ if(APPLE)
3639 )
3740endif ()
3841
39- INCLUDE (../GetPybind11.cmake )
42+ include (../GetPybind11.cmake )
4043pybind11_add_module (qsim_basic pybind_main_basic.cpp )
4144
4245target_link_libraries (qsim_basic PUBLIC OpenMP::OpenMP_CXX )
Original file line number Diff line number Diff line change @@ -16,7 +16,12 @@ cmake_minimum_required(VERSION 3.28)
1616project (qsim LANGUAGES CXX CUDA )
1717
1818if (WIN32 )
19- add_compile_options (/O2 /openmp )
19+ # Always apply AVX2 and openmp on Windows
20+ add_compile_options (/openmp )
21+
22+ # Only apply /O2 if the configuration is RELEASE.
23+ # This prevents a conflict with /RTC1 in DEBUG builds.
24+ add_compile_options ($<$<CONFIG :RELEASE >:/O2 >
2025else ()
2126 add_compile_options (-O3 -flto=auto )
2227endif ()
Original file line number Diff line number Diff line change @@ -16,7 +16,10 @@ cmake_minimum_required(VERSION 3.28)
1616project (qsim LANGUAGES CXX CUDA )
1717
1818if (WIN32 )
19- add_compile_options (/O2 /openmp )
19+ add_compile_options (/openmp )
20+ # Only apply /O2 if the configuration is RELEASE.
21+ # This prevents a conflict with /RTC1 in DEBUG builds.
22+ add_compile_options ($<$<CONFIG :RELEASE >:/O2 >
2023else ()
2124 add_compile_options (-O3 -flto=auto )
2225endif ()
@@ -36,7 +39,7 @@ if(APPLE)
3639 )
3740endif ()
3841
39- INCLUDE (../GetPybind11.cmake )
42+ include (../GetPybind11.cmake )
4043find_package (Python3 3.10 REQUIRED )
4144
4245include_directories (${pybind11_INCLUDE_DIRS} )
Original file line number Diff line number Diff line change @@ -19,7 +19,10 @@ include(CheckLanguage)
1919check_language (CUDA )
2020
2121if (WIN32 )
22- add_compile_options (/O2 /openmp )
22+ add_compile_options (/openmp )
23+ # Only apply /O2 if the configuration is RELEASE.
24+ # This prevents a conflict with /RTC1 in DEBUG builds.
25+ add_compile_options ($<$<CONFIG :RELEASE >:/O2 >
2326else ()
2427 add_compile_options (-O3 -flto=auto )
2528endif ()
Original file line number Diff line number Diff line change @@ -16,12 +16,15 @@ cmake_minimum_required(VERSION 3.28)
1616project (qsim LANGUAGES CXX HIP )
1717
1818if (WIN32 )
19- add_compile_options (/O2 /openmp )
19+ add_compile_options (/openmp )
20+ # Only apply /O2 if the configuration is RELEASE.
21+ # This prevents a conflict with /RTC1 in DEBUG builds.
22+ add_compile_options ($<$<CONFIG :RELEASE >:/O2 >
2023else ()
2124 add_compile_options (-O3 -flto=auto )
2225endif ()
2326
24- INCLUDE (../GetPybind11.cmake )
27+ include (../GetPybind11.cmake )
2528find_package (PythonLibs 3.10 REQUIRED )
2629
2730list (APPEND CMAKE_MODULE_PATH "/opt/rocm/lib/cmake/hip" )
Original file line number Diff line number Diff line change 1515cmake_minimum_required (VERSION 3.28 )
1616project (qsim)
1717
18- IF (WIN32 )
19- add_compile_options (/O2 /openmp )
20- ELSE ()
18+ if (WIN32 )
19+ add_compile_options (/openmp )
20+ # Only apply /O2 if the configuration is RELEASE.
21+ # This prevents a conflict with /RTC1 in DEBUG builds.
22+ add_compile_options ($<$<CONFIG :RELEASE >:/O2 >
23+ else ()
2124 add_compile_options (-msse4.1 -O3 -flto=auto )
22- ENDIF ()
25+ endif ()
2326
2427if (APPLE )
2528 include_directories (
@@ -36,7 +39,7 @@ if(APPLE)
3639 )
3740endif ()
3841
39- INCLUDE (../GetPybind11.cmake )
42+ include (../GetPybind11.cmake )
4043pybind11_add_module (qsim_sse pybind_main_sse.cpp )
4144
4245target_link_libraries (qsim_sse PUBLIC OpenMP::OpenMP_CXX )
You can’t perform that action at this time.
0 commit comments