aclrtMemsetD32Async
Applicable Products
Product |
Supported |
|---|---|
√ |
|
√ |
|
√ |
|
☓ |
|
☓ |
|
☓ |
Function
Initializes memory, filling it with a specified 32-bit unsigned integer value. This is an asynchronous API. The difference between this API and aclrtMemset is that this API fills the memory in units of 32-bit unsigned integers, where N indicates the number of 32-bit unsigned integers to fill.
Prototype
1 | aclError aclrtMemsetD32Async(void *ptr, size_t memSize, uint32_t value, size_t N, aclrtStream stream) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
ptr |
Input |
Pointer to the memory start address. The memory can only be allocated by the aclrtMallocHost or aclrtMalloc API. |
memSize |
Input |
Maximum memory length, in bytes (≥ N x 4). |
value |
Input |
32-bit unsigned integer to fill. |
N |
Input |
Number of 32-bit unsigned integers to fill. |
stream |
Input |
Stream for executing the memory initialization task. For details about the type definition, see aclrtStream. |
Returns
0 on success; otherwise, failure. For details, see aclError.
Restrictions
- The device memory initialization task will be delivered to the specified stream for execution. The caller must ensure that the stream is valid and not destroyed. If nullptr is passed to stream, the default stream is used.
- A host memory initialization task is not delivered to a stream for execution. Therefore, the behavior of this API is the same as that of the aclrtMemsetD32 API.