Stream memory operations#

hipError_t hipStreamWaitValue32(hipStream_t stream, void *ptr, uint32_t value, unsigned int flags, uint32_t mask)#

Enqueues a wait command to the stream.[BETA].

Enqueues a wait command to the stream, all operations enqueued on this stream after this, will not execute until the defined wait condition is true.

hipStreamWaitValueGte: waits until *ptr&mask >= value hipStreamWaitValueEq : waits until *ptr&mask == value hipStreamWaitValueAnd: waits until ((*ptr&mask) & value) != 0 hipStreamWaitValueNor: waits until ~((*ptr&mask) | (value&mask)) != 0

Note

when using ‘hipStreamWaitValueNor’, mask is applied on both ‘value’ and ‘*ptr’.

Note

Support for hipStreamWaitValue32 can be queried using ‘hipDeviceGetAttribute()’ and ‘hipDeviceAttributeCanUseStreamWaitValue’ flag.

Warning

This API is marked as Beta. While this feature is complete, it can change and might have outstanding issues.

Parameters:
  • stream[in] - Stream identifier

  • ptr[in] - Pointer to memory object allocated using ‘hipMallocSignalMemory’ flag

  • value[in] - Value to be used in compare operation

  • flags[in] - Defines the compare operation, supported values are hipStreamWaitValueGte hipStreamWaitValueEq, hipStreamWaitValueAnd and hipStreamWaitValueNor

  • mask[in] - Mask to be applied on value at memory before it is compared with value, default value is set to enable every bit

Returns:

hipSuccess, hipErrorInvalidValue

hipError_t hipStreamWaitValue64(hipStream_t stream, void *ptr, uint64_t value, unsigned int flags, uint64_t mask)#

Enqueues a wait command to the stream.[BETA].

Enqueues a wait command to the stream, all operations enqueued on this stream after this, will not execute until the defined wait condition is true.

hipStreamWaitValueGte: waits until *ptr&mask >= value hipStreamWaitValueEq : waits until *ptr&mask == value hipStreamWaitValueAnd: waits until ((*ptr&mask) & value) != 0 hipStreamWaitValueNor: waits until ~((*ptr&mask) | (value&mask)) != 0

Note

when using ‘hipStreamWaitValueNor’, mask is applied on both ‘value’ and ‘*ptr’.

Note

Support for hipStreamWaitValue64 can be queried using ‘hipDeviceGetAttribute()’ and ‘hipDeviceAttributeCanUseStreamWaitValue’ flag.

Warning

This API is marked as Beta. While this feature is complete, it can change and might have outstanding issues.

Parameters:
  • stream[in] - Stream identifier

  • ptr[in] - Pointer to memory object allocated using ‘hipMallocSignalMemory’ flag

  • value[in] - Value to be used in compare operation

  • flags[in] - Defines the compare operation, supported values are hipStreamWaitValueGte hipStreamWaitValueEq, hipStreamWaitValueAnd and hipStreamWaitValueNor.

  • mask[in] - Mask to be applied on value at memory before it is compared with value default value is set to enable every bit

Returns:

hipSuccess, hipErrorInvalidValue

hipError_t hipStreamWriteValue32(hipStream_t stream, void *ptr, uint32_t value, unsigned int flags)#

Enqueues a write command to the stream.[BETA].

Enqueues a write command to the stream, write operation is performed after all earlier commands on this stream have completed the execution.

Warning

This API is marked as Beta. While this feature is complete, it can change and might have outstanding issues.

Parameters:
  • stream[in] - Stream identifier

  • ptr[in] - Pointer to a GPU accessible memory object

  • value[in] - Value to be written

  • flags[in] - reserved, ignored for now, will be used in future releases

Returns:

hipSuccess, hipErrorInvalidValue

hipError_t hipStreamWriteValue64(hipStream_t stream, void *ptr, uint64_t value, unsigned int flags)#

Enqueues a write command to the stream.[BETA].

Enqueues a write command to the stream, write operation is performed after all earlier commands on this stream have completed the execution.

Warning

This API is marked as Beta. While this feature is complete, it can change and might have outstanding issues.

Parameters:
  • stream[in] - Stream identifier

  • ptr[in] - Pointer to a GPU accessible memory object

  • value[in] - Value to be written

  • flags[in] - reserved, ignored for now, will be used in future releases

Returns:

hipSuccess, hipErrorInvalidValue