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

Function DYNAMIC_SECTION

tests/unit/matrices.cpp:634–673  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

632 for (auto [label, mpi, gpu, omp] : getSupportedDeployments()) {
633
634 DYNAMIC_SECTION( label ) {
635
636 int minNumQubits = std::max({1, getLog2(getQuESTEnv().numNodes)});
637 int maxNumQubits = std::min({20, minNumQubits + 1});
638 int numQubits = GENERATE_COPY( range(minNumQubits, maxNumQubits+1) );
639 CAPTURE( numQubits );
640
641 FullStateDiagMatr matr = createCustomFullStateDiagMatr(numQubits, mpi, gpu, omp);
642
643 // check state is blank
644 bool isBlank = true;
645 for (qindex i=0; i<matr.numElemsPerNode && isBlank; i++)
646 isBlank = (matr.cpuElems[i] == qcomp(0,0));
647 REQUIRE( isBlank );
648
649 // dimensions
650 REQUIRE( matr.numQubits == numQubits );
651 REQUIRE( matr.numElems == getPow2(numQubits) );
652 REQUIRE( matr.numElemsPerNode == matr.numElems / (mpi? getQuESTEnv().numNodes : 1) );
653
654 // accelerations
655 REQUIRE( matr.isDistributed == (int) (mpi && getQuESTEnv().numNodes > 1) );
656 REQUIRE( matr.isGpuAccelerated == (int) gpu );
657 REQUIRE( matr.isMultithreaded == (int) omp );
658
659 // default properties
660 REQUIRE( *(matr.isApproxUnitary) == -1 ); // unknown
661 REQUIRE( *(matr.isApproxHermitian) == -1 ); // unknown
662 REQUIRE( *(matr.isApproxNonZero) == -1 ); // unknown
663 REQUIRE( *(matr.isStrictlyNonNegative) == -1 ); // unknown
664 REQUIRE( *(matr.wasGpuSynced) == 0 ); // false
665
666 // pointers
667 REQUIRE( matr.cpuElems != nullptr );
668
669 if (gpu) REQUIRE( matr.gpuElems != nullptr );
670 else REQUIRE( matr.gpuElems == nullptr );
671
672 destroyFullStateDiagMatr(matr);
673 }
674 }
675
676 }

Callers

nothing calls this directly

Calls 6

getLog2Function · 0.85
getQuESTEnvFunction · 0.85
getPow2Function · 0.85
destroyFullStateDiagMatrFunction · 0.85
syncFullStateDiagMatrFunction · 0.85

Tested by

no test coverage detected