| 441 | |
| 442 | |
| 443 | extern "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 |
no test coverage detected