20 #include <hwloc/autogen/config.h>
21 #include <hwloc/linux.h>
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");
|
|