Skip to content

Commit f1f3403

Browse files
ENABLE_CPP_INT
1 parent 2ea0895 commit f1f3403

File tree

6 files changed

+8
-5
lines changed

6 files changed

+8
-5
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required (VERSION 3.10)
2-
project (Qrack VERSION 10.4.1 DESCRIPTION "High Performance Quantum Bit Simulation" LANGUAGES CXX)
2+
project (Qrack VERSION 10.5.0 DESCRIPTION "High Performance Quantum Bit Simulation" LANGUAGES CXX)
33

44
# Installation commands
55
include (GNUInstallDirs)

cmake/Boost.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
option (ENABLE_BOOST "Use Boost libraries (if available)" ON)
2+
option (ENABLE_CPP_INT "Use Boost library cpp_int (if available)" OFF)
23
if (ENABLE_BOOST)
34
if (POLICY CMP0167)
45
cmake_policy(SET CMP0167 NEW)

include/common/config.h.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#cmakedefine ENABLE_ALU 1
22
#cmakedefine ENABLE_BCD 1
3+
#cmakedefine ENABLE_CPP_INT 1
34
#cmakedefine ENABLE_DEVRAND 1
45
#cmakedefine ENABLE_ENV_VARS 1
56
#cmakedefine ENABLE_FMA 1

include/common/qrack_functions.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
\
3737
return 0;
3838

39-
#if (QBCAPPOW < 7) || ((QBCAPPOW < 8) && defined(__SIZEOF_INT128__)) || ((QBCAPPOW > 7) && defined(BOOST_AVAILABLE))
39+
#if (QBCAPPOW < 7) || ((QBCAPPOW < 8) && defined(__SIZEOF_INT128__)) || \
40+
((QBCAPPOW > 7) && defined(BOOST_AVAILABLE) && defined(ENABLE_CPP_INT))
4041
inline void bi_not_ip(bitCapInt* left) { *left = ~(*left); }
4142
inline void bi_and_ip(bitCapInt* left, const bitCapInt& right) { *left &= right; }
4243
inline void bi_or_ip(bitCapInt* left, const bitCapInt& right) { *left |= right; }
@@ -146,7 +147,7 @@ inline bitLenInt popCountOcl(bitCapIntOcl n)
146147

147148
#if (QBCAPPOW < 7) || ((QBCAPPOW < 8) && defined(__SIZEOF_INT128__))
148149
inline int bi_log2(const bitCapInt& n) { return log2Ocl((bitCapIntOcl)n); }
149-
#elif (QBCAPPOW > 7) && defined(BOOST_AVAILABLE)
150+
#elif (QBCAPPOW > 7) && defined(BOOST_AVAILABLE) && defined(ENABLE_CPP_INT)
150151
inline int bi_log2(const bitCapInt& n) { return boost::multiprecision::msb(n); }
151152
#endif
152153
inline bitLenInt log2(bitCapInt n) { return (bitLenInt)bi_log2(n); }

include/common/qrack_types.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ constexpr bitCapInt QRACK_MAX_UINT = ~0U;
7373
#define bitCapInt unsigned __int128
7474
#define QRACK_MAX_QUBITS 128
7575
constexpr bitCapInt QRACK_MAX_UINT = ~0U;
76-
#elif BOOST_AVAILABLE
76+
#elif ENABLE_CPP_INT && BOOST_AVAILABLE
7777
#include <boost/multiprecision/cpp_int.hpp>
7878
constexpr size_t QRACK_MAX_QUBITS = (1 << QBCAPPOW);
7979
typedef boost::multiprecision::cpp_int bitCapInt;

include/statevector.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include <future>
2626
#endif
2727

28-
#if (QBCAPPOW > 6) && BOOST_AVAILABLE
28+
#if ENABLE_CPP_INT && (QBCAPPOW > 6) && BOOST_AVAILABLE
2929
#include <map>
3030
#define SparseStateVecMap std::map<bitCapInt, complex>
3131
#else

0 commit comments

Comments
 (0)