cubecl_hip_sys

Function hipLaunchHostFunc

Source
pub unsafe extern "C" fn hipLaunchHostFunc(
    stream: hipStream_t,
    fn_: hipHostFn_t,
    userData: *mut c_void,
) -> hipError_t
Expand description

@brief Enqueues a host function call in a stream.

@param [in] stream - The stream to enqueue work in. @param [in] fn - The function to call once enqueued preceeding operations are complete. @param [in] userData - User-specified data to be passed to the function.

@returns #hipSuccess, #hipErrorInvalidResourceHandle, #hipErrorInvalidValue, #hipErrorNotSupported

The host function to call in this API will be executed after the preceding operations in the stream are complete. The function is a blocking operation that blocks operations in the stream that follow it, until the function is returned. Event synchronization and internal callback functions make sure enqueued operations will execute in order, in the stream.

The host function must not make any HIP API calls. The host function is non-reentrant. It must not perform sychronization with any operation that may depend on other processing execution but is not enqueued to run earlier in the stream.

Host functions that are enqueued respectively in different non-blocking streams can run concurrently.

@warning This API is marked as beta, meaning, while this is feature complete, it is still open to changes and may have outstanding issues.