Initialization and Version#
Functions | |
hipError_t | hipInit (unsigned int flags) |
Explicitly initializes the HIP runtime. | |
hipError_t | hipDriverGetVersion (int *driverVersion) |
Returns the approximate HIP driver version. | |
hipError_t | hipRuntimeGetVersion (int *runtimeVersion) |
Returns the approximate HIP Runtime version. | |
hipError_t | hipDeviceGet (hipDevice_t *device, int ordinal) |
Returns a handle to a compute device. | |
hipError_t | hipDeviceComputeCapability (int *major, int *minor, hipDevice_t device) |
Returns the compute capability of the device. | |
hipError_t | hipDeviceGetName (char *name, int len, hipDevice_t device) |
Returns an identifer string for the device. | |
hipError_t | hipDeviceGetUuid (hipUUID *uuid, hipDevice_t device) |
Returns an UUID for the device.[BETA]. | |
hipError_t | hipDeviceGetP2PAttribute (int *value, hipDeviceP2PAttr attr, int srcDevice, int dstDevice) |
Returns a value for attribute of link between two devices. | |
hipError_t | hipDeviceGetPCIBusId (char *pciBusId, int len, int device) |
Returns a PCI Bus Id string for the device, overloaded to take int device ID. | |
hipError_t | hipDeviceGetByPCIBusId (int *device, const char *pciBusId) |
Returns a handle to a compute device. | |
hipError_t | hipDeviceTotalMem (size_t *bytes, hipDevice_t device) |
Returns the total amount of memory on the device. | |
Detailed Description
This section describes the initializtion and version functions of HIP runtime API.
Function Documentation
◆ hipDeviceComputeCapability()
hipError_t hipDeviceComputeCapability | ( | int * | major, |
int * | minor, | ||
hipDevice_t | device | ||
) |
Returns the compute capability of the device.
- Parameters
-
[out] major Major compute capability version number [out] minor Minor compute capability version number [in] device Device ordinal
- Returns
- hipSuccess, hipErrorInvalidDevice
◆ hipDeviceGet()
hipError_t hipDeviceGet | ( | hipDevice_t * | device, |
int | ordinal | ||
) |
Returns a handle to a compute device.
- Parameters
-
[out] device Handle of device [in] ordinal Device ordinal
- Returns
- hipSuccess, hipErrorInvalidDevice
◆ hipDeviceGetByPCIBusId()
hipError_t hipDeviceGetByPCIBusId | ( | int * | device, |
const char * | pciBusId | ||
) |
Returns a handle to a compute device.
- Parameters
-
[out] device The handle of the device [in] pciBusId The string of PCI Bus Id for the device
◆ hipDeviceGetName()
hipError_t hipDeviceGetName | ( | char * | name, |
int | len, | ||
hipDevice_t | device | ||
) |
Returns an identifer string for the device.
- Parameters
-
[out] name String of the device name [in] len Maximum length of string to store in device name [in] device Device ordinal
- Returns
- hipSuccess, hipErrorInvalidDevice
◆ hipDeviceGetP2PAttribute()
hipError_t hipDeviceGetP2PAttribute | ( | int * | value, |
hipDeviceP2PAttr | attr, | ||
int | srcDevice, | ||
int | dstDevice | ||
) |
Returns a value for attribute of link between two devices.
- Parameters
-
[out] value Pointer of the value for the attrubute [in] attr enum of hipDeviceP2PAttr to query [in] srcDevice The source device of the link [in] dstDevice The destination device of the link
- Returns
- hipSuccess, hipErrorInvalidDevice
◆ hipDeviceGetPCIBusId()
hipError_t hipDeviceGetPCIBusId | ( | char * | pciBusId, |
int | len, | ||
int | device | ||
) |
Returns a PCI Bus Id string for the device, overloaded to take int device ID.
- Parameters
-
[out] pciBusId The string of PCI Bus Id format for the device [in] len Maximum length of string [in] device The device ordinal
- Returns
- hipSuccess, hipErrorInvalidDevice
◆ hipDeviceGetUuid()
hipError_t hipDeviceGetUuid | ( | hipUUID * | uuid, |
hipDevice_t | device | ||
) |
Returns an UUID for the device.[BETA].
- Parameters
-
[out] uuid UUID for the device [in] device device ordinal
- Warning
- This API is marked as Beta. While this feature is complete, it can change and might have outstanding issues.
◆ hipDeviceTotalMem()
hipError_t hipDeviceTotalMem | ( | size_t * | bytes, |
hipDevice_t | device | ||
) |
Returns the total amount of memory on the device.
- Parameters
-
[out] bytes The size of memory in bytes, on the device [in] device The ordinal of the device
- Returns
- hipSuccess, hipErrorInvalidDevice
◆ hipDriverGetVersion()
hipError_t hipDriverGetVersion | ( | int * | driverVersion | ) |
Returns the approximate HIP driver version.
- Parameters
-
[out] driverVersion driver version
- Returns
- hipSuccess, hipErrorInvalidValue
- 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 some features which were introduced in later CUDA SDK revisions. 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 also
- hipRuntimeGetVersion
◆ hipInit()
hipError_t hipInit | ( | unsigned int | flags | ) |
Explicitly initializes the HIP runtime.
- Parameters
-
[in] flags Initialization flag, should be zero.
Most HIP APIs implicitly initialize the HIP runtime. This API provides control over the timing of the initialization.
- Returns
- hipSuccess, hipErrorInvalidValue
◆ hipRuntimeGetVersion()
hipError_t hipRuntimeGetVersion | ( | int * | runtimeVersion | ) |
Returns the approximate HIP Runtime version.
- Parameters
-
[out] runtimeVersion HIP runtime version
- Returns
- hipSuccess, hipErrorInvalidValue
- Warning
- The version definition of HIP runtime is different from CUDA. On AMD platform, the function returns HIP runtime version, while on NVIDIA platform, it returns CUDA runtime version. And there is no mapping/correlation between HIP version and CUDA version.
- See also
- hipDriverGetVersion