Merge branch 'privatestaging' of https://github.com/AMDComputeLibraries/HIP-privatestaging into privatestaging
[ROCm/hip commit: c300ffe458]
Cette révision appartient à :
@@ -98,6 +98,7 @@ typedef struct hipDeviceProp_t {
|
|||||||
int pciBusID; ///< PCI Bus ID.
|
int pciBusID; ///< PCI Bus ID.
|
||||||
int pciDeviceID; ///< PCI Device ID.
|
int pciDeviceID; ///< PCI Device ID.
|
||||||
size_t maxSharedMemoryPerMultiProcessor; ///< Maximum Shared Memory Per Multiprocessor.
|
size_t maxSharedMemoryPerMultiProcessor; ///< Maximum Shared Memory Per Multiprocessor.
|
||||||
|
int isMultiGpuBoard; ///< 1 if device is on a multi-GPU board, 0 if not.
|
||||||
} hipDeviceProp_t;
|
} hipDeviceProp_t;
|
||||||
|
|
||||||
|
|
||||||
@@ -188,6 +189,7 @@ typedef enum hipDeviceAttribute_t {
|
|||||||
hipDeviceAttributePciBusId, ///< PCI Bus ID.
|
hipDeviceAttributePciBusId, ///< PCI Bus ID.
|
||||||
hipDeviceAttributePciDeviceId, ///< PCI Device ID.
|
hipDeviceAttributePciDeviceId, ///< PCI Device ID.
|
||||||
hipDeviceAttributeMaxSharedMemoryPerMultiprocessor, ///< Maximum Shared Memory Per Multiprocessor.
|
hipDeviceAttributeMaxSharedMemoryPerMultiprocessor, ///< Maximum Shared Memory Per Multiprocessor.
|
||||||
|
hipDeviceAttributeIsMultiGpuBoard, ///< Multiple GPU devices.
|
||||||
} hipDeviceAttribute_t;
|
} hipDeviceAttribute_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -266,6 +266,8 @@ inline static hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t att
|
|||||||
cdattr = cudaDevAttrPciDeviceId; break;
|
cdattr = cudaDevAttrPciDeviceId; break;
|
||||||
case hipDeviceAttributeMaxSharedMemoryPerMultiprocessor:
|
case hipDeviceAttributeMaxSharedMemoryPerMultiprocessor:
|
||||||
cdattr = cudaDevAttrMaxSharedMemoryPerMultiprocessor; break;
|
cdattr = cudaDevAttrMaxSharedMemoryPerMultiprocessor; break;
|
||||||
|
case hipDeviceAttributeIsMultiGpuBoard:
|
||||||
|
cdattr = cudaDevAttrIsMultiGpuBoard; break;
|
||||||
default:
|
default:
|
||||||
cerror = cudaErrorInvalidValue; break;
|
cerror = cudaErrorInvalidValue; break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ void printDeviceProp (int deviceId)
|
|||||||
cout << setw(w1) << "pciDeviceID: " << props.pciDeviceID << endl;
|
cout << setw(w1) << "pciDeviceID: " << props.pciDeviceID << endl;
|
||||||
cout << setw(w1) << "multiProcessorCount: " << props.multiProcessorCount << endl;
|
cout << setw(w1) << "multiProcessorCount: " << props.multiProcessorCount << endl;
|
||||||
cout << setw(w1) << "maxThreadsPerMultiProcessor: " << props.maxThreadsPerMultiProcessor << endl;
|
cout << setw(w1) << "maxThreadsPerMultiProcessor: " << props.maxThreadsPerMultiProcessor << endl;
|
||||||
|
cout << setw(w1) << "isMultiGpuBoard: " << props.isMultiGpuBoard << endl;
|
||||||
cout << setw(w1) << "clockRate: " << (float)props.clockRate / 1000.0 << " Mhz" << endl;
|
cout << setw(w1) << "clockRate: " << (float)props.clockRate / 1000.0 << " Mhz" << endl;
|
||||||
#ifdef USE_ROCR_20
|
#ifdef USE_ROCR_20
|
||||||
cout << setw(w1) << "memoryClockRate: " << (float)props.memoryClockRate / 1000.0 << " Mhz" << endl;
|
cout << setw(w1) << "memoryClockRate: " << (float)props.memoryClockRate / 1000.0 << " Mhz" << endl;
|
||||||
|
|||||||
@@ -654,6 +654,21 @@ hsa_status_t get_region_info(hsa_region_t region, void* data)
|
|||||||
return HSA_STATUS_SUCCESS;
|
return HSA_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Determines if the given agent is of type HSA_DEVICE_TYPE_GPU and counts it.
|
||||||
|
static hsa_status_t countGpuAgents(hsa_agent_t agent, void *data) {
|
||||||
|
if (data == NULL) {
|
||||||
|
return HSA_STATUS_ERROR_INVALID_ARGUMENT;
|
||||||
|
}
|
||||||
|
hsa_device_type_t device_type;
|
||||||
|
hsa_status_t status = hsa_agent_get_info(agent, HSA_AGENT_INFO_DEVICE, &device_type);
|
||||||
|
if (status != HSA_STATUS_SUCCESS) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
if (device_type == HSA_DEVICE_TYPE_GPU) {
|
||||||
|
(*static_cast<int*>(data))++;
|
||||||
|
}
|
||||||
|
return HSA_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
// Internal version,
|
// Internal version,
|
||||||
hipError_t ihipDevice_t::getProperties(hipDeviceProp_t* prop)
|
hipError_t ihipDevice_t::getProperties(hipDeviceProp_t* prop)
|
||||||
@@ -672,6 +687,14 @@ hipError_t ihipDevice_t::getProperties(hipDeviceProp_t* prop)
|
|||||||
return hipErrorInvalidDevice;
|
return hipErrorInvalidDevice;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Iterates over the agents to determine Multiple GPU devices
|
||||||
|
// using the countGpuAgents callback.
|
||||||
|
int gpuAgentsCount = 0;
|
||||||
|
err = hsa_iterate_agents(countGpuAgents, &gpuAgentsCount);
|
||||||
|
if (err == HSA_STATUS_INFO_BREAK) { err = HSA_STATUS_SUCCESS; }
|
||||||
|
DeviceErrorCheck(err);
|
||||||
|
prop->isMultiGpuBoard = 0 ? gpuAgentsCount < 2 : 1;
|
||||||
|
|
||||||
// Get agent name
|
// Get agent name
|
||||||
err = hsa_agent_get_info(_hsa_agent, HSA_AGENT_INFO_NAME, &(prop->name));
|
err = hsa_agent_get_info(_hsa_agent, HSA_AGENT_INFO_NAME, &(prop->name));
|
||||||
DeviceErrorCheck(err);
|
DeviceErrorCheck(err);
|
||||||
@@ -1270,6 +1293,8 @@ hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t attr, int device)
|
|||||||
*pi = prop->pciDeviceID; break;
|
*pi = prop->pciDeviceID; break;
|
||||||
case hipDeviceAttributeMaxSharedMemoryPerMultiprocessor:
|
case hipDeviceAttributeMaxSharedMemoryPerMultiprocessor:
|
||||||
*pi = prop->maxSharedMemoryPerMultiProcessor; break;
|
*pi = prop->maxSharedMemoryPerMultiProcessor; break;
|
||||||
|
case hipDeviceAttributeIsMultiGpuBoard:
|
||||||
|
*pi = prop->isMultiGpuBoard; break;
|
||||||
default:
|
default:
|
||||||
e = hipErrorInvalidValue; break;
|
e = hipErrorInvalidValue; break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ int main(int argc, char *argv[])
|
|||||||
CHECK(test_hipDeviceGetAttribute(deviceId, hipDeviceAttributeMemoryBusWidth, props.memoryBusWidth));
|
CHECK(test_hipDeviceGetAttribute(deviceId, hipDeviceAttributeMemoryBusWidth, props.memoryBusWidth));
|
||||||
#endif
|
#endif
|
||||||
CHECK(test_hipDeviceGetAttribute(deviceId, hipDeviceAttributeMultiprocessorCount, props.multiProcessorCount));
|
CHECK(test_hipDeviceGetAttribute(deviceId, hipDeviceAttributeMultiprocessorCount, props.multiProcessorCount));
|
||||||
|
CHECK(test_hipDeviceGetAttribute(deviceId, hipDeviceAttributeIsMultiGpuBoard, props.isMultiGpuBoard));
|
||||||
CHECK(test_hipDeviceGetAttribute(deviceId, hipDeviceAttributeComputeMode, props.computeMode));
|
CHECK(test_hipDeviceGetAttribute(deviceId, hipDeviceAttributeComputeMode, props.computeMode));
|
||||||
CHECK(test_hipDeviceGetAttribute(deviceId, hipDeviceAttributeL2CacheSize, props.l2CacheSize));
|
CHECK(test_hipDeviceGetAttribute(deviceId, hipDeviceAttributeL2CacheSize, props.l2CacheSize));
|
||||||
CHECK(test_hipDeviceGetAttribute(deviceId, hipDeviceAttributeMaxThreadsPerMultiProcessor, props.maxThreadsPerMultiProcessor));
|
CHECK(test_hipDeviceGetAttribute(deviceId, hipDeviceAttributeMaxThreadsPerMultiProcessor, props.maxThreadsPerMultiProcessor));
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ syn keyword hipFunctionName expf __expf exp logf __logf log
|
|||||||
" Runtime Data Types
|
" Runtime Data Types
|
||||||
syn keyword hipType hipDeviceProp_t
|
syn keyword hipType hipDeviceProp_t
|
||||||
syn keyword hipType hipError_t
|
syn keyword hipType hipError_t
|
||||||
|
syn keyword hipType hipStream_t
|
||||||
|
|
||||||
" Runtime functions
|
" Runtime functions
|
||||||
syn keyword hipFunctionName hipBindTexture hipBindTextureToArray
|
syn keyword hipFunctionName hipBindTexture hipBindTextureToArray
|
||||||
@@ -154,6 +155,8 @@ syn keyword hipFunctionName hipUnbindTexture
|
|||||||
" HIP Flags
|
" HIP Flags
|
||||||
syn keyword hipFlags hipFilterModePoint
|
syn keyword hipFlags hipFilterModePoint
|
||||||
syn keyword hipFlags hipMemcpyHostToDevice
|
syn keyword hipFlags hipMemcpyHostToDevice
|
||||||
|
syn keyword hipFlags hipMemcpyDeviceToDevice
|
||||||
|
syn keyword hipFlags hipMemcpyHostToHost
|
||||||
syn keyword hipFlags hipMemcpyDeviceToHost
|
syn keyword hipFlags hipMemcpyDeviceToHost
|
||||||
syn keyword hipFlags hipMemcpyHostToHost
|
syn keyword hipFlags hipMemcpyHostToHost
|
||||||
syn keyword hipFlags hipMemcpyDeviceToDevice
|
syn keyword hipFlags hipMemcpyDeviceToDevice
|
||||||
|
|||||||
Référencer dans un nouveau ticket
Bloquer un utilisateur