Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Simulation/Native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ set(MICROSOFT_QUANTUM_SIMULATOR_VERSION $ENV{ASSEMBLY_VERSION})
set(MICROSOFT_QUANTUM_VERSION_STRING "quarcsw simulator version ${MICROSOFT_QUANTUM_SIMULATOR_VERSION}")
MESSAGE(STATUS "QUARCSW version: ${MICROSOFT_QUANTUM_SIMULATOR_VERSION}")

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS)
Expand Down
15 changes: 10 additions & 5 deletions src/Simulation/Native/src/SafeInt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ Please read the leading comments before using the class.
#define CPLUSPLUS_STD CPLUSPLUS_98
#elif __cplusplus < 201402L
#define CPLUSPLUS_STD CPLUSPLUS_11
#else
#elif __cplusplus < 201703L
#define CPLUSPLUS_STD CPLUSPLUS_14
#else
#define CPLUSPLUS_STD CPLUSPLUS_17
#endif

#elif SAFEINT_COMPILER == VISUAL_STUDIO_COMPILER
Expand All @@ -60,10 +62,13 @@ Please read the leading comments before using the class.
#elif _MSC_VER < 1910 // VS 2015
#define CPLUSPLUS_STD CPLUSPLUS_11

#else // VS 2017 or later
#elif _MSC_VER < 1926 // VS 2017
#define CPLUSPLUS_STD CPLUSPLUS_14

#else // VS 2019 or later
// Note - there is a __cpp_constexpr test now, but everything prior to VS 2017 reports incorrect values
// and this version always supports at least the CPLUSPLUS_14 approach
#define CPLUSPLUS_STD CPLUSPLUS_14
#define CPLUSPLUS_STD CPLUSPLUS_17

#endif

Expand All @@ -72,8 +77,8 @@ Please read the leading comments before using the class.
#define CPLUSPLUS_STD CPLUSPLUS_98
#endif // Determine C++ support level

#if (SAFEINT_COMPILER == CLANG_COMPILER || SAFEINT_COMPILER == GCC_COMPILER) && CPLUSPLUS_STD < CPLUSPLUS_11
#error Must compile with --std=c++11, preferably --std=c++14 to use constexpr improvements
#if (SAFEINT_COMPILER == CLANG_COMPILER || SAFEINT_COMPILER == GCC_COMPILER) && CPLUSPLUS_STD < CPLUSPLUS_17
#error Must compile with --std=c++17
#endif

#define CONSTEXPR_NONE 0
Expand Down
3 changes: 3 additions & 0 deletions src/Simulation/Native/src/simulator/wavefunction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <limits>
#include <random>
#include <vector>
#include <optional>

#include "types.hpp"
#include "gates.hpp"
Expand Down Expand Up @@ -341,6 +342,8 @@ class Wavefunction
std::vector<qubit_t> qubitmap_; // mapping of logical to physical qubits
int usage_;

std::optional<int> foo;

// randomness support
RngEngine rng_;
Fused fused_;
Expand Down