目录

Append

Function Description

Appends tiling data. If the length of the appended tiling data exceeds the maximum, the appending fails.

Function Prototype

template<typename T, typename std::enable_if<std::is_standard_layout<T>::value, int>::type = 0>  ge::graphStatus Append(const T &data);
template<typename T, typename std::enable_if<std::is_standard_layout<T>::value, int>::type = 0>  ge::graphStatus Append(const T *data, size_t append_num);

Parameters

parameter Input/Output Description
T Input Type of appended tiling data.
const T &data Input Appended tiling data instance.
const T *data Input Start address of appended tiling data.
append_num Input Number of appended tiling data elements. A total of append_num tiling data elements of the T type are appended.

Return Value

Restrictions

The appended tiling data must comply with standard_layout, that is, memory tiling.

Calling Example

auto td_buf = TilingData::CreateCap(100U);
auto td = reinterpret_cast<TilingData *>(td_buf.get());
 
// 1
struct AppendData{
  int a = 10;
  int b = 100;
};
AppendData ad;
auto ret = td->Append<AppendData>(ad); // ge::GRAPH_SUCCESS
 
// 2
size_t append_num = 10;
int32_t *td = new int32_t[append_num];
auto ret = td->Append<int32_t>(td, append_num); // ge::GRAPH_SUCCESS
 
// 3
size_t append_num = 50;
int32_t *td = new int32_t[append_num];
auto ret = td->Append<int32_t>(td, append_num); // ge::GRAPH_FAILED