BDFID (BusID/DeviceID/FunctionID) support.
Except FunctionID (or DomainID in CUDA) support, because cudaDeviceProp::pciDomainID is not reported by CUDA.
Αυτή η υποβολή περιλαμβάνεται σε:
@@ -310,7 +310,16 @@ hipError_t ihipDevice_t::getProperties(hipDeviceProp_t* prop)
|
||||
//prop->clockInstructionRate = counterHz / 1000;
|
||||
prop->clockInstructionRate = 100*1000; /* TODO-RT - hard-code until HSART has function to properly report clock */
|
||||
|
||||
// Get Agent BDFID (bus/device/function ID)
|
||||
uint16_t bdf_id = 1;
|
||||
err = hsa_agent_get_info(_hsa_agent, (hsa_agent_info_t)HSA_AMD_AGENT_INFO_BDFID, &bdf_id);
|
||||
DeviceErrorCheck(err);
|
||||
|
||||
// BDFID is 16bit uint: [8bit - BusID | 5bit - Device ID | 3bit - Function/DomainID]
|
||||
// TODO/Clarify: cudaDeviceProp::pciDomainID how to report?
|
||||
// prop->pciDomainID = bdf_id & 0x7;
|
||||
prop->pciDeviceID = (bdf_id>>3) & 0x1F;
|
||||
prop->pciBusID = (bdf_id>>8) & 0xFF;
|
||||
|
||||
// Masquerade as a 3.0-level device. This will change as more HW functions are properly supported.
|
||||
// Application code should use the arch.has* to do detailed feature detection.
|
||||
@@ -839,6 +848,10 @@ hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t attr, int device)
|
||||
*pi = prop->major; break;
|
||||
case hipDeviceAttributeComputeCapabilityMinor:
|
||||
*pi = prop->minor; break;
|
||||
case hipDeviceAttributePciBusId:
|
||||
*pi = prop->pciBusID; break;
|
||||
case hipDeviceAttributePciDeviceId:
|
||||
*pi = prop->pciDeviceID; break;
|
||||
default:
|
||||
e = hipErrorInvalidValue; break;
|
||||
}
|
||||
|
||||
Αναφορά σε νέο ζήτημα
Block a user