Skip to content

Commit 9274dbc

Browse files
authored
fix the MacOS compilation error (#18)
* fix the MacOS compilation error * change the types to uint64_t
1 parent c1b44c8 commit 9274dbc

5 files changed

Lines changed: 11 additions & 10 deletions

File tree

src/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ OPT_COPTS = select({
2727
"-fno-fast-math",
2828
"-flto",
2929
"-march=native",
30+
"-mmacosx-version-min=10.15"
3031
],
3132
":debug": ["-Og"],
3233
}) + ["-std=c++20"]

src/simplex.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ void SimplexDecoder::init_ilp() {
148148
highs->setOptionValue("output_flag", config.verbose);
149149
}
150150

151-
void SimplexDecoder::decode_to_errors(const std::vector<size_t>& detections) {
151+
void SimplexDecoder::decode_to_errors(const std::vector<uint64_t>& detections) {
152152
predicted_errors_buffer.clear();
153153
// Adjust the constraints for the detection events
154154
for (size_t d : detections) {
@@ -345,7 +345,7 @@ common::ObservablesMask SimplexDecoder::mask_from_errors(
345345
}
346346

347347
common::ObservablesMask SimplexDecoder::decode(
348-
const std::vector<size_t>& detections) {
348+
const std::vector<uint64_t>& detections) {
349349
decode_to_errors(detections);
350350
return mask_from_errors(predicted_errors_buffer);
351351
}

src/simplex.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ struct SimplexDecoder {
5656

5757
// Clears the predicted_errors_buffer and fills it with the decoded errors for
5858
// these detection events.
59-
void decode_to_errors(const std::vector<size_t>& detections);
59+
void decode_to_errors(const std::vector<uint64_t>& detections);
6060
// Returns the bitwise XOR of all the observables bitmasks of all errors in
6161
// the predicted errors buffer.
6262
common::ObservablesMask mask_from_errors(
6363
const std::vector<size_t>& predicted_errors);
6464
// Returns the sum of the likelihood costs (minus-log-likelihood-ratios) of
6565
// all errors in the predicted errors buffer.
6666
double cost_from_errors(const std::vector<size_t>& predicted_errors);
67-
common::ObservablesMask decode(const std::vector<size_t>& detections);
67+
common::ObservablesMask decode(const std::vector<uint64_t>& detections);
6868

6969
void decode_shots(std::vector<stim::SparseShot>& shots,
7070
std::vector<common::ObservablesMask>& obs_predicted);

src/tesseract.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ struct VectorBoolHash {
9999
}
100100
};
101101

102-
void TesseractDecoder::decode_to_errors(const std::vector<size_t>& detections) {
102+
void TesseractDecoder::decode_to_errors(const std::vector<uint64_t>& detections) {
103103
std::vector<size_t> best_errors;
104104
double best_cost = std::numeric_limits<double>::max();
105105
assert(config.det_orders.size());
@@ -192,7 +192,7 @@ void TesseractDecoder::to_node(const QNode& qnode,
192192
}
193193
}
194194

195-
void TesseractDecoder::decode_to_errors(const std::vector<size_t>& detections,
195+
void TesseractDecoder::decode_to_errors(const std::vector<uint64_t>& detections,
196196
size_t det_order) {
197197
size_t det_beam = config.det_beam;
198198
predicted_errors_buffer.clear();
@@ -454,7 +454,7 @@ common::ObservablesMask TesseractDecoder::mask_from_errors(
454454
}
455455

456456
common::ObservablesMask TesseractDecoder::decode(
457-
const std::vector<size_t>& detections) {
457+
const std::vector<uint64_t>& detections) {
458458
decode_to_errors(detections);
459459
return mask_from_errors(predicted_errors_buffer);
460460
}

src/tesseract.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ struct TesseractDecoder {
6464

6565
// Clears the predicted_errors_buffer and fills it with the decoded errors for
6666
// these detection events.
67-
void decode_to_errors(const std::vector<size_t>& detections);
67+
void decode_to_errors(const std::vector<uint64_t>& detections);
6868

6969
// Clears the predicted_errors_buffer and fills it with the decoded errors for
7070
// these detection events, using a specified detector ordering index.
71-
void decode_to_errors(const std::vector<size_t>& detections,
71+
void decode_to_errors(const std::vector<uint64_t>& detections,
7272
size_t det_order);
7373
// Returns the bitwise XOR of all the observables bitmasks of all errors in
7474
// the predicted errors buffer.
@@ -77,7 +77,7 @@ struct TesseractDecoder {
7777
// Returns the sum of the likelihood costs (minus-log-likelihood-ratios) of
7878
// all errors in the predicted errors buffer.
7979
double cost_from_errors(const std::vector<size_t>& predicted_errors);
80-
common::ObservablesMask decode(const std::vector<size_t>& detections);
80+
common::ObservablesMask decode(const std::vector<uint64_t>& detections);
8181

8282
void decode_shots(std::vector<stim::SparseShot>& shots,
8383
std::vector<common::ObservablesMask>& obs_predicted);

0 commit comments

Comments
 (0)