HIP: Heterogenous-computing Interface for Portability
Functions
Launch API to support the triple-chevron syntax
Collaboration diagram for Launch API to support the triple-chevron syntax:

Functions

hipError_t hipConfigureCall (dim3 gridDim, dim3 blockDim, size_t sharedMem __dparm(0), hipStream_t stream __dparm(0))
 Configure a kernel launch. More...
 
hipError_t hipSetupArgument (const void *arg, size_t size, size_t offset)
 Set a kernel argument. More...
 
hipError_t hipLaunchByPtr (const void *func)
 Launch a kernel. More...
 
hipError_t __hipPushCallConfiguration (dim3 gridDim, dim3 blockDim, size_t sharedMem __dparm(0), hipStream_t stream __dparm(0))
 Push configuration of a kernel launch. More...
 
hipError_t __hipPopCallConfiguration (dim3 *gridDim, dim3 *blockDim, size_t *sharedMem, hipStream_t *stream)
 Pop configuration of a kernel launch. More...
 
hipError_t hipLaunchKernel (const void *function_address, dim3 numBlocks, dim3 dimBlocks, void **args, size_t sharedMemBytes __dparm(0), hipStream_t stream __dparm(0))
 C compliant kernel launch API. More...
 
hipError_t hipMemPrefetchAsync (const void *dev_ptr, size_t count, int device, hipStream_t stream __dparm(0))
 Prefetches memory to the specified destination device using AMD HMM. More...
 
hipError_t hipMemAdvise (const void *dev_ptr, size_t count, hipMemoryAdvise advice, int device)
 Advise about the usage of a given memory range to AMD HMM. More...
 
hipError_t hipMemRangeGetAttribute (void *data, size_t data_size, hipMemRangeAttribute attribute, const void *dev_ptr, size_t count)
 Query an attribute of a given memory range in AMD HMM. More...
 
hipError_t hipMemRangeGetAttributes (void **data, size_t *data_sizes, hipMemRangeAttribute *attributes, size_t num_attributes, const void *dev_ptr, size_t count)
 Query attributes of a given memory range in AMD HMM. More...
 
hipError_t hipStreamAttachMemAsync (hipStream_t stream, hipDeviceptr_t *dev_ptr, size_t length __dparm(0), unsigned int flags __dparm(hipMemAttachSingle))
 Attach memory to a stream asynchronously in AMD HMM. More...
 

Detailed Description



Function Documentation

◆ __hipPopCallConfiguration()

hipError_t __hipPopCallConfiguration ( dim3 gridDim,
dim3 blockDim,
size_t *  sharedMem,
hipStream_t stream 
)

Pop configuration of a kernel launch.

Parameters
[out]gridDimgrid dimension specified as multiple of blockDim.
[out]blockDimblock dimensions specified in work-items
[out]sharedMemAmount of dynamic shared memory to allocate for this kernel. The kernel can access this with HIP_DYNAMIC_SHARED.
[out]streamStream where the kernel should be dispatched. May be 0, in which case the default stream is used with associated synchronization rules.
Returns
hipSuccess, hipInvalidDevice, hipErrorNotInitialized, hipErrorInvalidValue

◆ __hipPushCallConfiguration()

hipError_t __hipPushCallConfiguration ( dim3  gridDim,
dim3  blockDim,
size_t sharedMem   __dparm0,
hipStream_t stream   __dparm
)

Push configuration of a kernel launch.

Parameters
[in]gridDimgrid dimension specified as multiple of blockDim.
[in]blockDimblock dimensions specified in work-items
[in]sharedMemAmount of dynamic shared memory to allocate for this kernel. The kernel can access this with HIP_DYNAMIC_SHARED.
[in]streamStream where the kernel should be dispatched. May be 0, in which case the default stream is used with associated synchronization rules.
Returns
hipSuccess, hipInvalidDevice, hipErrorNotInitialized, hipErrorInvalidValue

◆ hipConfigureCall()

hipError_t hipConfigureCall ( dim3  gridDim,
dim3  blockDim,
size_t sharedMem   __dparm0,
hipStream_t stream   __dparm
)

Configure a kernel launch.

Parameters
[in]gridDimgrid dimension specified as multiple of blockDim.
[in]blockDimblock dimensions specified in work-items
[in]sharedMemAmount of dynamic shared memory to allocate for this kernel. The kernel can access this with HIP_DYNAMIC_SHARED.
[in]streamStream where the kernel should be dispatched. May be 0, in which case the default stream is used with associated synchronization rules.
Returns
hipSuccess, hipInvalidDevice, hipErrorNotInitialized, hipErrorInvalidValue

◆ hipLaunchByPtr()

hipError_t hipLaunchByPtr ( const void *  func)

Launch a kernel.

Parameters
[in]funcKernel to launch.
Returns
hipSuccess, hipInvalidDevice, hipErrorNotInitialized, hipErrorInvalidValue

◆ hipLaunchKernel()

hipError_t hipLaunchKernel ( const void *  function_address,
dim3  numBlocks,
dim3  dimBlocks,
void **  args,
size_t sharedMemBytes   __dparm0,
hipStream_t stream   __dparm
)

C compliant kernel launch API.

Parameters
[in]function_address- kernel stub function pointer.
[in]numBlocks- number of blocks
[in]dimBlocks- dimension of a block
[in]args- kernel arguments
[in]sharedMemBytes- Amount of dynamic shared memory to allocate for this kernel. The Kernel can access this with HIP_DYNAMIC_SHARED.
[in]stream- Stream where the kernel should be dispatched. May be 0, in which case th default stream is used with associated synchronization rules.
Returns
hipSuccess, hipErrorInvalidValue, hipInvalidDevice

◆ hipMemAdvise()

hipError_t hipMemAdvise ( const void *  dev_ptr,
size_t  count,
hipMemoryAdvise  advice,
int  device 
)

Advise about the usage of a given memory range to AMD HMM.

Parameters
[in]dev_ptrpointer to memory to set the advice for
[in]countsize in bytes of the memory range
[in]adviceadvice to be applied for the specified memory range
[in]devicedevice to apply the advice for
Returns
hipSuccess, hipErrorInvalidValue

◆ hipMemPrefetchAsync()

hipError_t hipMemPrefetchAsync ( const void *  dev_ptr,
size_t  count,
int  device,
hipStream_t stream   __dparm
)

Prefetches memory to the specified destination device using AMD HMM.

Parameters
[in]dev_ptrpointer to be prefetched
[in]countsize in bytes for prefetching
[in]devicedestination device to prefetch to
[in]streamstream to enqueue prefetch operation
Returns
hipSuccess, hipErrorInvalidValue

◆ hipMemRangeGetAttribute()

hipError_t hipMemRangeGetAttribute ( void *  data,
size_t  data_size,
hipMemRangeAttribute  attribute,
const void *  dev_ptr,
size_t  count 
)

Query an attribute of a given memory range in AMD HMM.

Parameters
[in/out]data a pointer to a memory location where the result of each attribute query will be written to
[in]data_sizethe size of data
[in]attributethe attribute to query
[in]dev_ptrstart of the range to query
[in]countsize of the range to query
Returns
hipSuccess, hipErrorInvalidValue

◆ hipMemRangeGetAttributes()

hipError_t hipMemRangeGetAttributes ( void **  data,
size_t *  data_sizes,
hipMemRangeAttribute attributes,
size_t  num_attributes,
const void *  dev_ptr,
size_t  count 
)

Query attributes of a given memory range in AMD HMM.

Parameters
[in/out]data a two-dimensional array containing pointers to memory locations where the result of each attribute query will be written to
[in]data_sizesan array, containing the sizes of each result
[in]attributesthe attribute to query
[in]num_attributesan array of attributes to query (numAttributes and the number of attributes in this array should match)
[in]dev_ptrstart of the range to query
[in]countsize of the range to query
Returns
hipSuccess, hipErrorInvalidValue

◆ hipSetupArgument()

hipError_t hipSetupArgument ( const void *  arg,
size_t  size,
size_t  offset 
)

Set a kernel argument.

Returns
hipSuccess, hipInvalidDevice, hipErrorNotInitialized, hipErrorInvalidValue
Parameters
[in]argPointer the argument in host memory.
[in]sizeSize of the argument.
[in]offsetOffset of the argument on the argument stack.

◆ hipStreamAttachMemAsync()

hipError_t hipStreamAttachMemAsync ( hipStream_t  stream,
hipDeviceptr_t *  dev_ptr,
size_t length   __dparm0,
unsigned int flags   __dparmhipMemAttachSingle 
)

Attach memory to a stream asynchronously in AMD HMM.

Parameters
[in]stream- stream in which to enqueue the attach operation
[in]dev_ptr- pointer to memory (must be a pointer to managed memory or to a valid host-accessible region of system-allocated memory)
[in]length- length of memory (defaults to zero)
[in]flags- must be one of cudaMemAttachGlobal, cudaMemAttachHost or cudaMemAttachSingle (defaults to cudaMemAttachSingle)
Returns
hipSuccess, hipErrorInvalidValue