IsSharedWith
Description
Determines whether the current TensorData object shares a memory block with another object and uses the same memory management function.
Prototype
bool IsSharedWith(const TensorData &other) const
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
other |
Input |
Another TensorData object |
Returns
true indicates that two objects share the same memory and use the same memory management function. Otherwise, false is returned.
Restrictions
None
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
Parent topic: TensorData