Init
API definition |
APP_ERROR Init(int dim, int capacity, faiss::MetricType metricType, const std::vector<int> &deviceList, int64_t resourceSize = -1); |
|---|---|
Function |
Initialization function of AscendIndexILFlat. |
Input |
int dim: dimension of the feature vectors managed by AscendIndexILFlat. int capacity: maximum database capacity. The API allocates capacity × dim × sizeof(fp16) bytes of memory data based on the value of capacity. faiss::MetricType metricType: feature distance category (vector inner product, Euclidean distance, and cosine similarity). const std::vector<int> &deviceList: resource configuration on the device. int64_t resourceSize: preset memory pool size on the device, in bytes. It is the memory space for storing intermediate results during computing to prevent performance fluctuation caused by dynamic memory allocation. The default parameter is -1, indicating that the size is 128 MB. |
Output |
N/A |
Return value |
APP_ERROR: return status. For details, see Return Code Reference. |
Restrictions |
|