20 #include <hwloc/autogen/config.h>
43 static __hwloc_inline
int
47 #ifdef HWLOC_LINUX_SYS
49 #define HWLOC_CUDA_DEVICE_SYSFS_PATH_MAX 128
54 char path[HWLOC_CUDA_DEVICE_SYSFS_PATH_MAX];
57 #if CUDA_VERSION >= 4000
58 cres = cuDeviceGetAttribute(&domainid, CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID, cudevice);
59 if (cres != CUDA_SUCCESS) {
64 cres = cuDeviceGetAttribute(&busid, CU_DEVICE_ATTRIBUTE_PCI_BUS_ID, cudevice);
65 if (cres != CUDA_SUCCESS) {
69 cres = cuDeviceGetAttribute(&deviceid, CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID, cudevice);
70 if (cres != CUDA_SUCCESS) {
75 sprintf(path,
"/sys/bus/pci/devices/%04x:%02x:%02x.0/local_cpus", domainid, busid, deviceid);
76 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 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
Macros to help interaction between hwloc and the CUDA Driver API.
static __hwloc_inline int hwloc_cuda_get_device_cpuset(hwloc_topology_t topology __hwloc_attribute_unused, CUdevice cudevice, hwloc_cpuset_t set)
Get the CPU set of logical processors that are physically close to device cudevice.
Definition: cuda.h:44