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

Function setFullStateDiagMatr

quest/src/api/matrices.cpp:443–456  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

441
442
443extern "C" void setFullStateDiagMatr(FullStateDiagMatr out, qindex startInd, qcomp* in, qindex numElems) {
444 validate_matrixFields(out, __func__);
445 validate_fullStateDiagMatrNewElems(out, startInd, numElems, __func__);
446 validate_matrixNewElemsPtrNotNull(in, __func__);
447
448 // overwrites both the CPU and GPU memory (if it exists), maintaining consistency.
449 // note that cpu_copyArray() isn't called directly here like setDiagMatr() above
450 // because we must handle when 'out' is and isn't distributed
451 localiser_fullstatediagmatr_setElems(out, startInd, in, numElems);
452
453 // even though we have not necessarily overwritten every element, we must mark
454 // the matrix as synced so that it can be subsequently used without error
455 markMatrixAsSynced(out);
456}
457
458
459

Tested by

no test coverage detected