Attribute hipDeviceAttributeIsMultiGpuBoard for obtaining Device property isMultiGpuBoard is added.

On HIP path property obtaining done through hsa_iterate_agents and counting the devices of HSA_DEVICE_TYPE_GPU type.

P.S.
On multi-boards systems it might be problems with detection what board a GPU plugged into (not tested).
This commit is contained in:
Evgeny Mankov
2016-02-25 23:44:39 +03:00
parent 4851cedf6c
commit 57e212606d
5 changed files with 31 additions and 0 deletions
+2
View File
@@ -98,6 +98,7 @@ typedef struct hipDeviceProp_t {
int pciBusID; ///< PCI Bus ID.
int pciDeviceID; ///< PCI Device ID.
size_t maxSharedMemoryPerMultiProcessor; ///< Maximum Shared Memory Per Multiprocessor.
int isMultiGpuBoard; ///< 1 if device is on a multi-GPU board, 0 if not.
} hipDeviceProp_t;
@@ -161,6 +162,7 @@ typedef enum hipDeviceAttribute_t {
hipDeviceAttributePciBusId, ///< PCI Bus ID.
hipDeviceAttributePciDeviceId, ///< PCI Device ID.
hipDeviceAttributeMaxSharedMemoryPerMultiprocessor, ///< Maximum Shared Memory Per Multiprocessor.
hipDeviceAttributeIsMultiGpuBoard, ///< Multiple GPU devices.
} hipDeviceAttribute_t;
/**
+2
View File
@@ -266,6 +266,8 @@ inline static hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t att
cdattr = cudaDevAttrPciDeviceId; break;
case hipDeviceAttributeMaxSharedMemoryPerMultiprocessor:
cdattr = cudaDevAttrMaxSharedMemoryPerMultiprocessor; break;
case hipDeviceAttributeIsMultiGpuBoard:
cdattr = cudaDevAttrIsMultiGpuBoard; break;
default:
cerror = cudaErrorInvalidValue; break;
}