API定义 |
APP_ERROR Init(uint32_t deviceId, uint32_t dim, uint32_t tokenNum, AlgorithmType algType = AlgorithmType::FLAT_COS_INT8, MemoryStrategy memoryStrategy = MemoryStrategy::PURE_DEVICE_MEMORY, uint32_t customAttrLen = 0, uint32_t customAttrBlockSize = 0); |
---|---|
功能描述 |
实例初始化函数。 |
输入 |
uint32_t deviceId:Index使用的设备ID。 uint32_t dim:底库向量的维度。 uint32_t tokenNum:当前时空库Token的最大数量,需要和生成对应的Mask生成算子Token数量一致 AlgorithmType type:底层使用的距离比对算法,默认为“AlgorithmType::FLAT_COS_INT8”,可选算法参见如下。
MemoryStrategy memoryStrategy:底层使用的内存策略,默认为“MemoryStrategy::PURE_DEVICE_MEMORY”,可选策略参见如下。
customAttrLen:自定义属性长度。 customAttrBlockSize:自定义属性blocksize的大小。 |
输出 |
无 |
返回值 |
无 |
约束说明 |
|