20 #include <hwloc/autogen/config.h>
21 #include <hwloc/linux.h>
22 #include <hwloc/helper.h>
40 CUdevice cudevice,
int *domain,
int *bus,
int *dev)
44 #if CUDA_VERSION >= 4000
45 cres = cuDeviceGetAttribute(domain, CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID, cudevice);
46 if (cres != CUDA_SUCCESS) {
53 cres = cuDeviceGetAttribute(bus, CU_DEVICE_ATTRIBUTE_PCI_BUS_ID, cudevice);
54 if (cres != CUDA_SUCCESS) {
58 cres = cuDeviceGetAttribute(dev, CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID, cudevice);
59 if (cres != CUDA_SUCCESS) {
81 #ifdef HWLOC_LINUX_SYS
83 #define HWLOC_CUDA_DEVICE_SYSFS_PATH_MAX 128
84 char path[HWLOC_CUDA_DEVICE_SYSFS_PATH_MAX];
86 int domainid, busid, deviceid;
96 sprintf(path,
"/sys/bus/pci/devices/%04x:%02x:%02x.0/local_cpus", domainid, busid, deviceid);
97 sysfile = fopen(path,
"r");
124 int domain, bus, dev;