get_location - 2.0 English

Vitis AI User Guide (UG1414)

Document ID
UG1414
Release Date
2022-01-20
Version
2.0 English

Get where the tensor buffer located.

Prototype

location_t get_location();

Parameters

None.

Returns

The tensor buffer location, a location_t enum type value.

The following table lists the location_t enum type.

Table 1. location_t enum type
Name Value Description
HOST_VIRT 0 Only accessible by the host.
HOST_PHY 1 Continuous physical memory, shared among host and device.
DEVICE_0 2 Only accessible by device_*.
DEVICE_1 3
DEVICE_2 4
DEVICE_3 5
DEVICE_4 6
DEVICE_5 7
DEVICE_6 8
DEVICE_7 9

Usage

vart::TensorBuffer* tb;
switch (tb->get_location()) {
            case vart::TensorBuffer::location_t::HOST_VIRT:
                  // do nothing
                  break;
            case vart::TensorBuffer::location_t::HOST_PHY:
                  // do nothing
                  break;
           default:
                  // do nothing
                  break;
      }