diff --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt index d738f5151e..a594271eb2 100644 --- a/mlir/CMakeLists.txt +++ b/mlir/CMakeLists.txt @@ -4,7 +4,7 @@ project(catalyst LANGUAGES CXX C) set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard to conform to") +set(CMAKE_CXX_STANDARD 20) find_package(MLIR REQUIRED CONFIG) find_package(MHLO REQUIRED CONFIG) diff --git a/mlir/lib/Catalyst/Transforms/CMakeLists.txt b/mlir/lib/Catalyst/Transforms/CMakeLists.txt index 77fb4d64b5..48f3357b45 100644 --- a/mlir/lib/Catalyst/Transforms/CMakeLists.txt +++ b/mlir/lib/Catalyst/Transforms/CMakeLists.txt @@ -42,7 +42,7 @@ set(DEPENDS ) add_mlir_library(${LIBRARY_NAME} STATIC ${SRC} LINK_LIBS PRIVATE ${LIBS} DEPENDS ${DEPENDS}) -target_compile_features(${LIBRARY_NAME} PUBLIC cxx_std_17) +target_compile_features(${LIBRARY_NAME} PUBLIC cxx_std_20) target_include_directories(${LIBRARY_NAME} PUBLIC . ${PROJECT_SOURCE_DIR}/include diff --git a/mlir/lib/Gradient/Transforms/CMakeLists.txt b/mlir/lib/Gradient/Transforms/CMakeLists.txt index 6495dc6cba..1bd2325348 100644 --- a/mlir/lib/Gradient/Transforms/CMakeLists.txt +++ b/mlir/lib/Gradient/Transforms/CMakeLists.txt @@ -32,7 +32,7 @@ set(DEPENDS ) add_mlir_library(${LIBRARY_NAME} STATIC ${SRC} LINK_LIBS PRIVATE ${LIBS} DEPENDS ${DEPENDS}) -target_compile_features(${LIBRARY_NAME} PUBLIC cxx_std_17) +target_compile_features(${LIBRARY_NAME} PUBLIC cxx_std_20) target_include_directories(${LIBRARY_NAME} PUBLIC . ${PROJECT_SOURCE_DIR}/include diff --git a/mlir/lib/Mitigation/Transforms/CMakeLists.txt b/mlir/lib/Mitigation/Transforms/CMakeLists.txt index 5f6b830539..2af124cd74 100644 --- a/mlir/lib/Mitigation/Transforms/CMakeLists.txt +++ b/mlir/lib/Mitigation/Transforms/CMakeLists.txt @@ -19,7 +19,7 @@ set(DEPENDS ) add_mlir_library(${LIBRARY_NAME} STATIC ${SRC} LINK_LIBS PRIVATE ${LIBS} DEPENDS ${DEPENDS}) -target_compile_features(${LIBRARY_NAME} PUBLIC cxx_std_17) +target_compile_features(${LIBRARY_NAME} PUBLIC cxx_std_20) target_include_directories(${LIBRARY_NAME} PUBLIC . ${PROJECT_SOURCE_DIR}/include diff --git a/mlir/lib/Quantum/Transforms/CMakeLists.txt b/mlir/lib/Quantum/Transforms/CMakeLists.txt index 96ba30d23e..f11209b6dd 100644 --- a/mlir/lib/Quantum/Transforms/CMakeLists.txt +++ b/mlir/lib/Quantum/Transforms/CMakeLists.txt @@ -30,7 +30,7 @@ set(DEPENDS ) add_mlir_library(${LIBRARY_NAME} STATIC ${SRC} LINK_LIBS PRIVATE ${LIBS} DEPENDS ${DEPENDS}) -target_compile_features(${LIBRARY_NAME} PUBLIC cxx_std_17) +target_compile_features(${LIBRARY_NAME} PUBLIC cxx_std_20) target_include_directories(${LIBRARY_NAME} PUBLIC . ${PROJECT_SOURCE_DIR}/include diff --git a/mlir/lib/Quantum/Transforms/remove_chained_self_inverse.cpp b/mlir/lib/Quantum/Transforms/remove_chained_self_inverse.cpp index 5b84674b15..838047f124 100644 --- a/mlir/lib/Quantum/Transforms/remove_chained_self_inverse.cpp +++ b/mlir/lib/Quantum/Transforms/remove_chained_self_inverse.cpp @@ -15,6 +15,7 @@ #define DEBUG_TYPE "remove-chained-self-inverse" #include +#include #include #include "llvm/Support/Debug.h" @@ -52,6 +53,8 @@ struct RemoveChainedSelfInversePass LLVM_DEBUG(dbgs() << "remove chained self inverse pass" << "\n"); + llvm::errs() << std::numbers::pi << "\n"; + // Run cse pass before running remove-chained-self-inverse, // to aid identifying equivalent SSA values when verifying // the gates have the same params diff --git a/setup.py b/setup.py index 100697ff81..a880cc9317 100644 --- a/setup.py +++ b/setup.py @@ -181,7 +181,7 @@ def run(self): "frontend/catalyst/utils/jax_cpu_lapack_kernels/lapack_kernels.cpp", "frontend/catalyst/utils/jax_cpu_lapack_kernels/lapack_kernels_using_lapack.cpp", ], - extra_compile_args=["-std=c++17"], + extra_compile_args=["-std=c++20"], ) cmdclass = {"build_ext": CustomBuildExtLinux} @@ -198,7 +198,7 @@ def run(self): "frontend/catalyst/utils/jax_cpu_lapack_kernels/lapack_kernels.cpp", "frontend/catalyst/utils/jax_cpu_lapack_kernels/lapack_kernels_using_lapack.cpp", ], - extra_compile_args=["-std=c++17"], + extra_compile_args=["-std=c++20"], ) cmdclass = {"build_ext": CustomBuildExtMacos} @@ -211,7 +211,7 @@ def run(self): ext._add_ldflags(["-L", lib_path_npymath]) # pylint: disable=protected-access ext._add_ldflags(["-lnpymath"]) # pylint: disable=protected-access ext._add_cflags(["-I", np.get_include()]) # pylint: disable=protected-access - ext._add_cflags(["-std=c++17"]) # pylint: disable=protected-access + ext._add_cflags(["-std=c++20"]) # pylint: disable=protected-access ext_modules.extend(intree_extension_list) # For any compiler packages seeking to be registered in PennyLane, it is imperative that they # expose the entry_points metadata under the designated group name `pennylane.compilers`, with