Skip to content

Commit

Permalink
Merge pull request #311 from devreal/fix-peer-check
Browse files Browse the repository at this point in the history
Fix check for peer access.
  • Loading branch information
devreal authored Nov 25, 2024
2 parents 33bea54 + b614df2 commit 334b83d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions ttg/ttg/parsec/ttg.h
Original file line number Diff line number Diff line change
Expand Up @@ -1088,12 +1088,15 @@ namespace ttg_parsec {
bool all_peer_access = true;
/* check whether all GPUs can access all peer GPUs */
for (int i = 0; (i < parsec_nb_devices) && all_peer_access; ++i) {
parsec_device_module_t *device = parsec_mca_device_get(i);
if (PARSEC_DEV_IS_GPU(device->type)) {
parsec_device_gpu_module_t *gpu_device = (parsec_device_gpu_module_t*)device;
parsec_device_module_t *idevice = parsec_mca_device_get(i);
if (PARSEC_DEV_IS_GPU(idevice->type)) {
parsec_device_gpu_module_t *gpu_device = (parsec_device_gpu_module_t*)idevice;
for (int j = 0; (j < parsec_nb_devices) && all_peer_access; ++j) {
if (PARSEC_DEV_IS_GPU(device->type)) {
all_peer_access = all_peer_access && (gpu_device->peer_access_mask & (1<<j));
if (i != j) { // because no device can access itself, says PaRSEC
parsec_device_module_t *jdevice = parsec_mca_device_get(j);
if (PARSEC_DEV_IS_GPU(jdevice->type)) {
all_peer_access &= (gpu_device->peer_access_mask & (1<<j)) ? true : false;
}
}
}
}
Expand Down

0 comments on commit 334b83d

Please sign in to comment.