|
HIP: Heterogenous-computing Interface for Portability
|
Functions | |
| hipError_t | hipDeviceSynchronize (void) |
| Blocks until the default device has completed all preceding requested tasks. More... | |
| hipError_t | hipDeviceReset (void) |
| Destroy all resources and reset all state on the default device in the current process. More... | |
| hipError_t | hipSetDevice (int device) |
| Set default device to be used for subsequent hip API calls from this thread. More... | |
| hipError_t | hipGetDevice (int *device) |
| Return the default device id for the calling host thread. More... | |
| hipError_t | hipGetDeviceCount (int *count) |
| Return number of compute-capable devices. More... | |
| hipError_t | hipDeviceGetAttribute (int *pi, hipDeviceAttribute_t attr, int device) |
| Query device attribute. More... | |
| hipError_t | hipGetDeviceProperties (hipDeviceProp_t *prop, int device) |
| Returns device properties. More... | |
| hipError_t | hipDeviceSetCacheConfig (hipFuncCache cacheConfig) |
| Set L1/Shared cache partition. More... | |
| hipError_t | hipDeviceGetCacheConfig (hipFuncCache *cacheConfig) |
| Set Cache configuration for a specific function. More... | |
| hipError_t | hipFuncSetCacheConfig (hipFuncCache config) |
| Set Cache configuration for a specific function. More... | |
| hipError_t | hipDeviceGetSharedMemConfig (hipSharedMemConfig *pConfig) |
| Get Shared memory bank configuration. More... | |
| hipError_t | hipDeviceSetSharedMemConfig (hipSharedMemConfig config) |
| Set Shared memory bank configuration. More... | |
| hipError_t hipDeviceGetAttribute | ( | int * | pi, |
| hipDeviceAttribute_t | attr, | ||
| int | device | ||
| ) |
Query device attribute.
| [out] | pi | pointer to value to return |
| [in] | attr | attribute to query |
| [in] | device | which device to query for information |
| hipError_t hipDeviceGetCacheConfig | ( | hipFuncCache * | cacheConfig | ) |
Set Cache configuration for a specific function.
Note: AMD devices and recent Nvidia GPUS do not support reconfigurable cache. This hint is ignored on those architectures.
| hipError_t hipDeviceGetSharedMemConfig | ( | hipSharedMemConfig * | pConfig | ) |
Get Shared memory bank configuration.
Note: AMD devices and recent Nvidia GPUS do not support shared cache banking, and the hint is ignored on those architectures.
| hipError_t hipDeviceReset | ( | void | ) |
Destroy all resources and reset all state on the default device in the current process.
Explicity destroy all memory allocations, events, and queues associated with the default device in the current process.
This function will reset the device immmediately, and then return after all resources have been freed. The caller must ensure that the device is not being accessed by any other host threads from the active process when this function is called.
| hipError_t hipDeviceSetCacheConfig | ( | hipFuncCache | cacheConfig | ) |
Set L1/Shared cache partition.
Note: AMD devices and recent Nvidia GPUS do not support reconfigurable cache. This hint is ignored on those architectures.
| hipError_t hipDeviceSetSharedMemConfig | ( | hipSharedMemConfig | config | ) |
Set Shared memory bank configuration.
Note: AMD devices and recent Nvidia GPUS do not support shared cache banking, and the hint is ignored on those architectures.
| hipError_t hipDeviceSynchronize | ( | void | ) |
Blocks until the default device has completed all preceding requested tasks.
This function waits for all streams on the default device to complete execution, and then returns.
| hipError_t hipFuncSetCacheConfig | ( | hipFuncCache | cacheConfig | ) |
Set Cache configuration for a specific function.
Note: AMD devices and recent Nvidia GPUS do not support reconfigurable cache. This hint is ignored on those architectures.
| hipError_t hipGetDevice | ( | int * | device | ) |
Return the default device id for the calling host thread.
| [out] | device | *device is written with the default device |
HIP maintains an default device for each thread using thread-local-storage. This device is used implicitly for HIP runtime APIs called by this thread. hipGetDevice returns in * device the default device for the calling host thread.
| hipError_t hipGetDeviceCount | ( | int * | count | ) |
Return number of compute-capable devices.
| [output] | count Returns number of compute-capable devices. |
Returns in *count the number of devices that have ability to run compute commands. If there are no such devices, then hipGetDeviceCount will return hipErrorNoDevice. If 1 or more devices can be found, then hipGetDeviceCount returns hipSuccess.
| hipError_t hipGetDeviceProperties | ( | hipDeviceProp_t * | props, |
| int | device | ||
| ) |
Returns device properties.
| [out] | prop | written with device properties |
| [in] | device | which device to query for information |
Populates hipGetDeviceProperties with information for the specified device.
HCC always returns 0 for maxThreadsPerMultiProcessor
HCC always returns 0 for regsPerBlock
HCC always returns 0 for l2CacheSize
HCC always returns 0 for maxThreadsPerMultiProcessor
HCC always returns 0 for regsPerBlock
HCC always returns 0 for l2CacheSize
| hipError_t hipSetDevice | ( | int | device | ) |
Set default device to be used for subsequent hip API calls from this thread.
| [in] | device | Valid device in range 0...hipGetDeviceCount(). |
Sets device as the default device for the calling host thread. Valid device id's are 0... (hipGetDeviceCount()-1).
Many HIP APIs implicitly use the "default device" :
This function may be called from any host thread. Multiple host threads may use the same device. This function does no synchronization with the previous or new device, and has very little runtime overhead. Applications can use hipSetDevice to quickly switch the default device before making a HIP runtime call which uses the default device.
The default device is stored in thread-local-storage for each thread. Thread-pool implementations may inherit the default device of the previous thread. A good practice is to always call hipSetDevice at the start of HIP coding sequency to establish a known standard device.
1.8.6