| 3859 | } |
| 3860 | |
| 3861 | void validate_numLindbladSuperPropagatorTerms(qindex numSuperTerms, const char* caller) { |
| 3862 | |
| 3863 | assertThat(numSuperTerms != 0, report::NUM_LINDBLAD_SUPER_PROPAGATOR_TERMS_OVERFLOWED, caller); |
| 3864 | |
| 3865 | // attempt to fetch RAM, and simply return if we fail; if we unknowingly |
| 3866 | // didn't have enough RAM, then alloc validation will trigger later |
| 3867 | size_t memPerNode = 0; |
| 3868 | try { |
| 3869 | memPerNode = mem_tryGetLocalRamCapacityInBytes(); |
| 3870 | } catch(mem::COULD_NOT_QUERY_RAM e) { |
| 3871 | return; |
| 3872 | } |
| 3873 | |
| 3874 | // check whether the superpropagator fits in memory |
| 3875 | bool fits = mem_canPauliStrSumFitInMemory(numSuperTerms, memPerNode); |
| 3876 | assertThat(fits, report::NEW_LINDBLAD_SUPER_PROPAGATOR_CANNOT_FIT_INTO_CPU_MEM, {{"${NUM_TERMS}", numSuperTerms}, {"${NUM_BYTES}", memPerNode}}, caller); |
| 3877 | |
| 3878 | } |
| 3879 | |
| 3880 | |
| 3881 |
no test coverage detected