Added hipRuntimeGetVersion function
Change-Id: I59ec2beacb5a94439deed0dcc8eb37d6de1cc900
This commit is contained in:
@@ -1468,6 +1468,10 @@ hipError_t hipDeviceTotalMem (size_t *bytes,hipDevice_t device);
|
||||
|
||||
/**
|
||||
* @brief Returns the approximate HIP driver version.
|
||||
*
|
||||
* @param [out] driverVersion
|
||||
*
|
||||
* @returns #hipSuccess, #hipErrorInavlidValue
|
||||
*
|
||||
* @warning The HIP feature set does not correspond to an exact CUDA SDK driver revision.
|
||||
* This function always set *driverVersion to 4 as an approximation though HIP supports
|
||||
@@ -1475,9 +1479,24 @@ hipError_t hipDeviceTotalMem (size_t *bytes,hipDevice_t device);
|
||||
* HIP apps code should not rely on the driver revision number here and should
|
||||
* use arch feature flags to test device capabilities or conditional compilation.
|
||||
*
|
||||
* @see hipRuntimeGetVersion
|
||||
*/
|
||||
hipError_t hipDriverGetVersion(int *driverVersion) ;
|
||||
|
||||
/**
|
||||
* @brief Returns the approximate HIP Runtime version.
|
||||
*
|
||||
* @param [out] runtimeVersion
|
||||
*
|
||||
* @returns #hipSuccess, #hipErrorInavlidValue
|
||||
*
|
||||
* @warning On HIP/HCC path this function returns HIP runtime patch version however on
|
||||
* HIP/NVCC path this function return CUDA runtime version.
|
||||
*
|
||||
* @see hipDriverGetVersion
|
||||
*/
|
||||
hipError_t hipRuntimeGetVersion(int *runtimeVersion) ;
|
||||
|
||||
/**
|
||||
* @brief Loads code object from file into a hipModule_t
|
||||
*
|
||||
|
||||
@@ -546,6 +546,11 @@ inline static hipError_t hipDriverGetVersion(int *driverVersion)
|
||||
return hipCUDAErrorTohipError(err);
|
||||
}
|
||||
|
||||
inline static hipError_t hipRuntimeGetVersion(int *runtimeVersion)
|
||||
{
|
||||
return hipCUDAErrorTohipError(cudaRuntimeGetVersion(runtimeVersion));
|
||||
}
|
||||
|
||||
inline static hipError_t hipDeviceCanAccessPeer ( int* canAccessPeer, int device, int peerDevice )
|
||||
{
|
||||
return hipCUDAErrorTohipError(cudaDeviceCanAccessPeer(canAccessPeer, device, peerDevice));
|
||||
|
||||
@@ -76,15 +76,32 @@ hipError_t hipDeviceGet(hipDevice_t *device, int deviceId)
|
||||
return ihipLogStatus(e);
|
||||
};
|
||||
|
||||
hipError_t hipDriverGetVersion(int *driverVersion)
|
||||
pError_t hipDriverGetVersion(int *driverVersion)
|
||||
{
|
||||
HIP_INIT_API(driverVersion);
|
||||
|
||||
hipError_t e = hipSuccess;
|
||||
if (driverVersion) {
|
||||
*driverVersion = 4;
|
||||
}
|
||||
else {
|
||||
e = hipErrorInvalidValue;
|
||||
}
|
||||
|
||||
return ihipLogStatus(hipSuccess);
|
||||
return ihipLogStatus(e);
|
||||
}
|
||||
|
||||
hipError_t hipRuntimeGetVersion(int *runtimeVersion)
|
||||
{
|
||||
HIP_INIT_API(runtimeVersion);
|
||||
hipError_t e = hipSuccess;
|
||||
if (runtimeVersion) {
|
||||
*runtimeVersion = HIP_VERSION_PATCH;
|
||||
}
|
||||
else {
|
||||
e = hipErrorInvalidValue;
|
||||
}
|
||||
|
||||
return ihipLogStatus(e);
|
||||
}
|
||||
|
||||
hipError_t hipCtxDestroy(hipCtx_t ctx)
|
||||
|
||||
Reference in New Issue
Block a user