acltdtDequeueData

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Function

Obtains data from a queue.

Prototype

1
aclError acltdtDequeueData(uint32_t qid, void *data, size_t dataSize, size_t *retDataSize, void *userData, size_t userDataSize, int32_t timeout)

Parameters

Parameter

Input/Output

Description

qid

Input

Queue from which data is obtained.

You must call acltdtCreateQueue to create a queue in advance.

data

Input/Output

Pointer to the buffer data.

The host buffer or device buffer is supported.

dataSize

Input

Size of buffer data, in bytes.

retDataSize

Output

Actual data size, in bytes.

userData

Input/Output

Pointer to the user-defined data.

If no user-defined data is available, set this parameter to nullptr.

userDataSize

Input

Size of the user-defined data (≤ 96 bytes).

If no user-defined data is available, set this parameter to 0.

timeout

Input

Wait timeout interval. If data is obtained from an empty queue, the system determines how to process the data based on the configured wait timeout interval.

The options are as follows:
  • -1: blocking mode. The system waits until the queue is not empty.
  • 0: non-blocking mode (for device only). When the queue is empty, an error is returned. You can configure a retry interval for this mode.
  • > 0: specific timeout interval, in milliseconds. When the queue is empty, an error is returned after the timeout interval has elapsed.

    The timeout interval varies with the operating system. The deviation is generally within a time slice of an operating system. For example, if the time slice of an operating system is 4 ms and the value of wait timeout interval is set to 1 ms, the actual timeout interval ranges from 1 ms to 5 ms. When the CPU load is high, the timeout interval may fluctuate.

Returns

0 on success; otherwise, failure. For details, see aclError.