Skip to content

Commit

Permalink
Fix build without hwloc
Browse files Browse the repository at this point in the history
  • Loading branch information
sthibaul committed May 10, 2024
1 parent 8962613 commit a4248a9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/drivers/cuda/driver_cuda.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ void _starpu_cuda_discover_devices(struct _starpu_machine_config *config)
#endif
}

#ifdef STARPU_HAVE_HWLOC
#ifdef STARPU_HAVE_NVML_H
static int _starpu_cuda_direct_link(struct _starpu_machine_config *config, unsigned devid1, unsigned devid2)
{
Expand Down Expand Up @@ -377,6 +378,7 @@ static int _starpu_cuda_direct_link(struct _starpu_machine_config *config, unsig
return 0;
}
#endif
#endif

static void _starpu_initialize_workers_cuda_gpuid(struct _starpu_machine_config *config)
{
Expand Down Expand Up @@ -629,13 +631,15 @@ void _starpu_cuda_init_worker_memory(struct _starpu_machine_config *config, int
_starpu_cuda_bus_ids[devid2+STARPU_MAXNUMANODES][devid+STARPU_MAXNUMANODES] = bus21;
_starpu_cuda_bus_ids[devid+STARPU_MAXNUMANODES][devid2+STARPU_MAXNUMANODES] = bus12;
#ifndef STARPU_SIMGRID
#ifdef STARPU_HAVE_HWLOC
#ifdef STARPU_HAVE_NVML_H
if (_starpu_cuda_direct_link(config, devid, devid2))
{
starpu_bus_set_ngpus(bus21, 1);
starpu_bus_set_ngpus(bus12, 1);
}
else
#endif
#endif
{
#if HAVE_DECL_HWLOC_CUDA_GET_DEVICE_OSDEV_BY_INDEX
Expand Down

0 comments on commit a4248a9

Please sign in to comment.