| 392 | |
| 393 | |
| 394 | bool gpu_areAnyNodesBoundToSameGpu() { |
| 395 | #if COMPILE_CUDA |
| 396 | assert_gpuHasBeenBound(hasGpuBeenBound); |
| 397 | |
| 398 | if (!comm_isInit()) |
| 399 | return false; |
| 400 | |
| 401 | // obtain bound GPU's UUID; a unique identifier 16-char identifier |
| 402 | auto uuidStr = getBoundGpuUuid(); |
| 403 | |
| 404 | // we can repurpose string-to-root sending to collect all uuids |
| 405 | auto allUuids = comm_gatherStringsToRoot(uuidStr.data(), uuidStr.size()); |
| 406 | auto uniqueUuids = std::set<std::string>(allUuids.begin(), allUuids.end()); |
| 407 | |
| 408 | // and assess whether they're all unique (non-root's bools are overwritten) |
| 409 | bool localGpusAreUnique = allUuids.size() == uniqueUuids.size(); |
| 410 | bool globalGpusAreUnique = comm_isTrueOnRootNode(localGpusAreUnique); |
| 411 | return ! globalGpusAreUnique; |
| 412 | |
| 413 | #else |
| 414 | error_gpuQueriedButGpuNotCompiled(); |
| 415 | return false; |
| 416 | #endif |
| 417 | } |
| 418 | |
| 419 | |
| 420 | void gpu_sync() { |
no test coverage detected