LoadUnzipIndex
Supported Products
Product |
Supported (√/x) |
|---|---|
x |
|
x |
|
x |
|
√ |
|
x |
|
x |
Function Usage
Loads the compression index table on GM to internal registers.
The index table is LoadDataUnzip compression information (such as compression length) to obtain compressed data.
The index table is generated offline by the compression tool based on the corresponding weight data. One LoadUnzipIndex instruction can load multiple index tables, but each LoadDataUnzip instruction can consume only one index table. Therefore, the order of index tables should be determined by the user to ensure their correspondence to the compressed data.
Prototype
1 2 | template <typename T = int8_t, typename Std::enable_if<Std::is_same<PrimT<T>, int8_t>::value, bool>::type = true> __aicore__ inline void LoadUnzipIndex(const GlobalTensor<T>& src, uint32_t numOfIndexTabEntry) |
Parameters
Parameter |
Description |
|---|---|
T |
Data type of the source operand.
The last template parameter is used only for checking the preceding data types. |
Parameter |
Input/Output |
Meaning |
|---|---|---|
src |
Input |
Source operand, index table address. The type is GlobalTensor. The src address must be 2-byte aligned. The src length must be an integer multiple of 512 bytes and cannot exceed 32 KB. |
numOfIndexTabEntry |
Input |
Input data, indicating the number of loaded index tables. The number of index tables must be greater than 0. |
Returns
None
Restrictions
- For details about the operand address alignment requirements, see General Address Alignment Restrictions.
- LoadUnzipIndex must be executed before any LoadDataUnzip instruction.
- The number of index tables loaded by LoadUnzipIndex must be greater than or equal to the number of times that the LoadDataUnzip instruction is executed.
Example
The calling example supports the
1 2 | indexGlobal.SetGlobalBuffer((__gm__ int8_t*)indexGm); AscendC::LoadUnzipIndex(indexGlobal, numOfIndexTabEntry); |