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

Function receiveArrayToGpuBuffer

quest/src/comm/comm_routines.cpp:470–491  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

468
469
470void receiveArrayToGpuBuffer(Qureg qureg, qindex numElems, int pairRank) {
471
472 qindex recvInd = getBufferRecvInd();
473
474 // receive to GPU memory directly if possible
475 if (gpu_isDirectGpuCommPossible()) {
476
477 // GPU synchronisation is not necessary; we're merely receiving to buffer
478
479 // communicate via GPUDirect or Peer-to-Peer
480 receiveArray(&qureg.gpuCommBuffer[recvInd], numElems, pairRank);
481
482 // otherwise, route through CPU
483 } else {
484
485 // receive array to CPU memory (buffer), at offset
486 receiveArray(&qureg.cpuCommBuffer[recvInd], numElems, pairRank);
487
488 // copy CPU memory (buffer) to GPU memory (buffer), at offset
489 gpu_copyCpuToGpu(qureg, &qureg.cpuCommBuffer[recvInd], &qureg.gpuCommBuffer[recvInd], numElems);
490 }
491}
492
493
494

Callers 1

Calls 4

getBufferRecvIndFunction · 0.85
receiveArrayFunction · 0.85
gpu_copyCpuToGpuFunction · 0.85

Tested by

no test coverage detected