MCPcopy Create free account
hub / github.com/QuEST-Kit/QuEST / assertSuperOpLocalMemDoesntExceedMaxSizeof

Function assertSuperOpLocalMemDoesntExceedMaxSizeof

quest/src/core/validation.cpp:2628–2641  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2626}
2627
2628void assertSuperOpLocalMemDoesntExceedMaxSizeof(int numQubits, bool isInKrausMap, const char* caller) {
2629
2630 int maxNumQubits = mem_getMaxNumSuperOpQubitsBeforeGlobalMemSizeofOverflow();
2631
2632 tokenSubs vars = {
2633 {"${NUM_QUBITS}", numQubits},
2634 {"${MAX_QUBITS}", maxNumQubits},
2635 {"${QCOMP_BYTES}", sizeof(qcomp)}};
2636
2637 auto msg = (isInKrausMap)?
2638 report::NEW_KRAUS_MAPS_SUPER_OP_MEM_WOULD_EXCEED_SIZEOF:
2639 report::NEW_SUPER_OP_MEM_WOULD_EXCEED_SIZEOF;
2640 assertThat(numQubits <= maxNumQubits, msg, vars, caller);
2641}
2642
2643void assertSuperOpFitsInCpuMem(int numQubits, bool isInKrausMap, const char* caller) {
2644

Callers 2

Tested by

no test coverage detected