Execution Control

Execution Control#

HIP Runtime API Reference: Execution Control
Execution Control
Collaboration diagram for Execution Control:

Functions

hipError_t hipFuncSetAttribute (const void *func, hipFuncAttribute attr, int value)
 Set attribute for a specific function.
 
hipError_t hipFuncSetCacheConfig (const void *func, hipFuncCache_t config)
 Set Cache configuration for a specific function.
 
hipError_t hipFuncSetSharedMemConfig (const void *func, hipSharedMemConfig config)
 Set shared memory configuation for a specific function.
 
template<class T >
hipError_t hipLaunchCooperativeKernel (T f, dim3 gridDim, dim3 blockDim, void **kernelParams, unsigned int sharedMemBytes, hipStream_t stream)
 Launches a device function.
 
template<class T >
hipError_t hipLaunchCooperativeKernelMultiDevice (hipLaunchParams *launchParamsList, unsigned int numDevices, unsigned int flags=0)
 Launches kernel function on multiple devices, where thread blocks can cooperate and synchronize on execution.
 

Detailed Description

This section describes the execution control functions of HIP runtime API.

Function Documentation

◆ hipFuncSetAttribute()

hipError_t hipFuncSetAttribute ( const void *  func,
hipFuncAttribute  attr,
int  value 
)

Set attribute for a specific function.

Parameters
[in]funcPointer of the function
[in]attrAttribute to set
[in]valueValue to set
Returns
hipSuccess, hipErrorInvalidDeviceFunction, hipErrorInvalidValue

Note: AMD devices and some Nvidia GPUS do not support shared cache banking, and the hint is ignored on those architectures.

◆ hipFuncSetCacheConfig()

hipError_t hipFuncSetCacheConfig ( const void *  func,
hipFuncCache_t  config 
)

Set Cache configuration for a specific function.

Parameters
[in]funcPointer of the function.
[in]configConfiguration to set.
Returns
hipSuccess, hipErrorNotInitialized Note: AMD devices and some Nvidia GPUS do not support reconfigurable cache. This hint is ignored on those architectures.

◆ hipFuncSetSharedMemConfig()

hipError_t hipFuncSetSharedMemConfig ( const void *  func,
hipSharedMemConfig  config 
)

Set shared memory configuation for a specific function.

Parameters
[in]funcPointer of the function
[in]configConfiguration
Returns
hipSuccess, hipErrorInvalidDeviceFunction, hipErrorInvalidValue

Note: AMD devices and some Nvidia GPUS do not support shared cache banking, and the hint is ignored on those architectures.

◆ hipLaunchCooperativeKernel()

template<class T >
hipError_t hipLaunchCooperativeKernel ( f,
dim3  gridDim,
dim3  blockDim,
void **  kernelParams,
unsigned int  sharedMemBytes,
hipStream_t  stream 
)
inline

Launches a device function.

Template Parameters
TThe type of the kernel function.
Parameters
[in]fKernel function to launch.
[in]gridDimGrid dimensions specified as multiple of blockDim.
[in]blockDimBlock dimensions specified in work-items.
[in]kernelParamsA list of kernel arguments.
[in]sharedMemBytesAmount of dynamic shared memory to allocate for this kernel. The HIP-Clang compiler provides support for extern shared declarations.
[in]streamStream which on the kernel launched.
Returns
hipSuccess, hipErrorLaunchFailure, hipErrorInvalidValue, hipErrorInvalidResourceHandle

◆ hipLaunchCooperativeKernelMultiDevice()

template<class T >
hipError_t hipLaunchCooperativeKernelMultiDevice ( hipLaunchParams launchParamsList,
unsigned int  numDevices,
unsigned int  flags = 0 
)
inline

Launches kernel function on multiple devices, where thread blocks can cooperate and synchronize on execution.

Parameters
[in]launchParamsListList of kernel launch parameters, one per device.
[in]numDevicesSize of launchParamsList array.
[in]flagsFlag to handle launch behavior.
Returns
hipSuccess, hipErrorLaunchFailure, hipErrorInvalidValue, hipErrorInvalidResourceHandle