16 #ifndef HWLOC_CUDART_H
17 #define HWLOC_CUDART_H
20 #include <hwloc/autogen/config.h>
23 #include <cuda_runtime_api.h>
43 static __hwloc_inline
int
47 #ifdef HWLOC_LINUX_SYS
49 #define HWLOC_CUDART_DEVICE_SYSFS_PATH_MAX 128
51 struct cudaDeviceProp prop;
52 char path[HWLOC_CUDART_DEVICE_SYSFS_PATH_MAX];
56 cerr = cudaGetDeviceProperties(&prop, device);
62 #if CUDART_VERSION >= 4000
63 pciDomainID = prop.pciDomainID;
66 sprintf(path,
"/sys/bus/pci/devices/%04x:%02x:%02x.0/local_cpus", pciDomainID, prop.pciBusID, prop.pciDeviceID);
67 sysfile = fopen(path,
"r");
HWLOC_DECLSPEC void hwloc_bitmap_copy(hwloc_bitmap_t dst, hwloc_const_bitmap_t src)
Copy the contents of bitmap src into the already allocated bitmap dst.
static __hwloc_inline int hwloc_cudart_get_device_cpuset(hwloc_topology_t topology __hwloc_attribute_unused, int device, hwloc_cpuset_t set)
Get the CPU set of logical processors that are physically close to device cudevice.
Definition: cudart.h:44
static __hwloc_inline hwloc_const_cpuset_t __hwloc_attribute_pure hwloc_topology_get_complete_cpuset(hwloc_topology_t topology)
Get complete CPU set.
Definition: helper.h:729
Macros to help interaction between hwloc and Linux.
HWLOC_DECLSPEC int hwloc_linux_parse_cpumap_file(FILE *file, hwloc_cpuset_t set)
Convert a linux kernel cpumap file file into hwloc CPU set.
Definition: topology-linux.c:1332