|
@@ -881,8 +881,10 @@ _starpu_init_topology (struct _starpu_machine_config *config)
|
|
config->topology.nhwcpus = config->topology.nhwpus = 1;
|
|
config->topology.nhwcpus = config->topology.nhwpus = 1;
|
|
#endif
|
|
#endif
|
|
|
|
|
|
- _starpu_cuda_discover_devices(config);
|
|
|
|
- _starpu_opencl_discover_devices(config);
|
|
|
|
|
|
+ if (config->conf.ncuda != 0)
|
|
|
|
+ _starpu_cuda_discover_devices(config);
|
|
|
|
+ if (config->conf.nopencl != 0)
|
|
|
|
+ _starpu_opencl_discover_devices(config);
|
|
#ifdef STARPU_USE_SCC
|
|
#ifdef STARPU_USE_SCC
|
|
config->topology.nhwscc = _starpu_scc_src_get_device_count();
|
|
config->topology.nhwscc = _starpu_scc_src_get_device_count();
|
|
#endif
|
|
#endif
|
|
@@ -1132,10 +1134,12 @@ unsigned
|
|
_starpu_topology_get_nhwcpu (struct _starpu_machine_config *config)
|
|
_starpu_topology_get_nhwcpu (struct _starpu_machine_config *config)
|
|
{
|
|
{
|
|
#if defined(STARPU_USE_OPENCL) || defined(STARPU_SIMGRID)
|
|
#if defined(STARPU_USE_OPENCL) || defined(STARPU_SIMGRID)
|
|
- _starpu_opencl_init();
|
|
|
|
|
|
+ if (config->conf.nopencl != 0)
|
|
|
|
+ _starpu_opencl_init();
|
|
#endif
|
|
#endif
|
|
#if defined(STARPU_USE_CUDA) || defined(STARPU_SIMGRID)
|
|
#if defined(STARPU_USE_CUDA) || defined(STARPU_SIMGRID)
|
|
- _starpu_init_cuda();
|
|
|
|
|
|
+ if (config->conf.ncuda != 0)
|
|
|
|
+ _starpu_init_cuda();
|
|
#endif
|
|
#endif
|
|
_starpu_init_topology(config);
|
|
_starpu_init_topology(config);
|
|
|
|
|
|
@@ -1146,10 +1150,12 @@ unsigned
|
|
_starpu_topology_get_nhwpu (struct _starpu_machine_config *config)
|
|
_starpu_topology_get_nhwpu (struct _starpu_machine_config *config)
|
|
{
|
|
{
|
|
#if defined(STARPU_USE_OPENCL) || defined(STARPU_SIMGRID)
|
|
#if defined(STARPU_USE_OPENCL) || defined(STARPU_SIMGRID)
|
|
- _starpu_opencl_init();
|
|
|
|
|
|
+ if (config->conf.nopencl != 0)
|
|
|
|
+ _starpu_opencl_init();
|
|
#endif
|
|
#endif
|
|
#if defined(STARPU_USE_CUDA) || defined(STARPU_SIMGRID)
|
|
#if defined(STARPU_USE_CUDA) || defined(STARPU_SIMGRID)
|
|
- _starpu_init_cuda();
|
|
|
|
|
|
+ if (config->conf.ncuda != 0)
|
|
|
|
+ _starpu_init_cuda();
|
|
#endif
|
|
#endif
|
|
_starpu_init_topology(config);
|
|
_starpu_init_topology(config);
|
|
|
|
|
|
@@ -1159,10 +1165,12 @@ _starpu_topology_get_nhwpu (struct _starpu_machine_config *config)
|
|
unsigned _starpu_topology_get_nnumanodes(struct _starpu_machine_config *config STARPU_ATTRIBUTE_UNUSED)
|
|
unsigned _starpu_topology_get_nnumanodes(struct _starpu_machine_config *config STARPU_ATTRIBUTE_UNUSED)
|
|
{
|
|
{
|
|
#if defined(STARPU_USE_OPENCL) || defined(STARPU_SIMGRID)
|
|
#if defined(STARPU_USE_OPENCL) || defined(STARPU_SIMGRID)
|
|
- _starpu_opencl_init();
|
|
|
|
|
|
+ if (config->conf.nopencl != 0)
|
|
|
|
+ _starpu_opencl_init();
|
|
#endif
|
|
#endif
|
|
#if defined(STARPU_USE_CUDA) || defined(STARPU_SIMGRID)
|
|
#if defined(STARPU_USE_CUDA) || defined(STARPU_SIMGRID)
|
|
- _starpu_init_cuda();
|
|
|
|
|
|
+ if (config->conf.ncuda != 0)
|
|
|
|
+ _starpu_init_cuda();
|
|
#endif
|
|
#endif
|
|
_starpu_init_topology(config);
|
|
_starpu_init_topology(config);
|
|
|
|
|
|
@@ -1516,10 +1524,12 @@ _starpu_init_machine_config(struct _starpu_machine_config *config, int no_mp_con
|
|
topology->nsched_ctxs = 0;
|
|
topology->nsched_ctxs = 0;
|
|
|
|
|
|
#if defined(STARPU_USE_OPENCL) || defined(STARPU_SIMGRID)
|
|
#if defined(STARPU_USE_OPENCL) || defined(STARPU_SIMGRID)
|
|
- _starpu_opencl_init();
|
|
|
|
|
|
+ if (config->conf.nopencl != 0)
|
|
|
|
+ _starpu_opencl_init();
|
|
#endif
|
|
#endif
|
|
#if defined(STARPU_USE_CUDA) || defined(STARPU_SIMGRID)
|
|
#if defined(STARPU_USE_CUDA) || defined(STARPU_SIMGRID)
|
|
- _starpu_init_cuda();
|
|
|
|
|
|
+ if (config->conf.ncuda != 0)
|
|
|
|
+ _starpu_init_cuda();
|
|
#endif
|
|
#endif
|
|
_starpu_init_topology(config);
|
|
_starpu_init_topology(config);
|
|
|
|
|
|
@@ -2017,14 +2027,16 @@ _starpu_bind_thread_on_cpu (
|
|
|
|
|
|
#ifdef STARPU_HAVE_HWLOC
|
|
#ifdef STARPU_HAVE_HWLOC
|
|
const struct hwloc_topology_support *support;
|
|
const struct hwloc_topology_support *support;
|
|
|
|
+ struct _starpu_machine_config *config = _starpu_get_machine_config();
|
|
|
|
|
|
#ifdef STARPU_USE_OPENCL
|
|
#ifdef STARPU_USE_OPENCL
|
|
- _starpu_opencl_init();
|
|
|
|
|
|
+ if (config->conf.nopencl != 0)
|
|
|
|
+ _starpu_opencl_init();
|
|
#endif
|
|
#endif
|
|
#ifdef STARPU_USE_CUDA
|
|
#ifdef STARPU_USE_CUDA
|
|
- _starpu_init_cuda();
|
|
|
|
|
|
+ if (config->conf.ncuda != 0)
|
|
|
|
+ _starpu_init_cuda();
|
|
#endif
|
|
#endif
|
|
- struct _starpu_machine_config *config = _starpu_get_machine_config();
|
|
|
|
_starpu_init_topology(config);
|
|
_starpu_init_topology(config);
|
|
|
|
|
|
if (workerid != STARPU_NOWORKERID && cpuid < STARPU_MAXCPUS)
|
|
if (workerid != STARPU_NOWORKERID && cpuid < STARPU_MAXCPUS)
|
|
@@ -2137,14 +2149,16 @@ _starpu_bind_thread_on_cpus (
|
|
#endif
|
|
#endif
|
|
#ifdef STARPU_HAVE_HWLOC
|
|
#ifdef STARPU_HAVE_HWLOC
|
|
const struct hwloc_topology_support *support;
|
|
const struct hwloc_topology_support *support;
|
|
|
|
+ struct _starpu_machine_config *config = _starpu_get_machine_config();
|
|
|
|
|
|
#ifdef STARPU_USE_OPENC
|
|
#ifdef STARPU_USE_OPENC
|
|
- _starpu_opencl_init();
|
|
|
|
|
|
+ if (config->conf.nopencl != 0)
|
|
|
|
+ _starpu_opencl_init();
|
|
#endif
|
|
#endif
|
|
#ifdef STARPU_USE_CUDA
|
|
#ifdef STARPU_USE_CUDA
|
|
- _starpu_init_cuda();
|
|
|
|
|
|
+ if (config->conf.ncuda != 0)
|
|
|
|
+ _starpu_init_cuda();
|
|
#endif
|
|
#endif
|
|
- struct _starpu_machine_config *config = _starpu_get_machine_config();
|
|
|
|
_starpu_init_topology(config);
|
|
_starpu_init_topology(config);
|
|
|
|
|
|
support = hwloc_topology_get_support(config->topology.hwtopology);
|
|
support = hwloc_topology_get_support(config->topology.hwtopology);
|