目录

IsSharedWith

Function Description

Determines whether the current TensorData object shares a memory block with another object and uses the same memory management function.

Function Prototype

bool IsSharedWith(const TensorData &other) const

Parameters

Parameter Input/Output Description
other Input Another TensorData object.

Return Value

true indicates that two objects share the same memory and use the same memory management function.

false indicates the opposite.

Restrictions

None

Calling Example

auto addr = reinterpret_cast<void *>(0x10);
TensorData td1(addr, HostAddrManager, 100U, kOnHost);
TensorData td2(addr, HostAddrManager, 100U, kOnHost);
bool is_shared_td = td1.IsSharedWith(td2); // true