Using DirectMapAdd to fix IVFFLAT parallel adding (#1842)
Using DirectMapAdd to fix IVFFLAT parallel adding (#1842)

Summary:
Signed-off-by: shengjun.li <shengjun.li@zilliz.com>

When `direct_map.type` is `DirectMap::Type::Array`, IVFFLAT parallel adding may fail here.
```C++
void DirectMap::add_single_id(idx_t id, idx_t list_no, size_t offset) {
    ...
    if (type == Array) {
        assert(id == array.size());
```

However, DirectMapAdd has solved it.

Pull Request resolved: https://github.com/facebookresearch/faiss/pull/1842

Reviewed By: beauby

Differential Revision: D28025735

Pulled By: mdouze

fbshipit-source-id: 74c423eacd226c9f7b1882532dcde517f6956409

facebookresearch/faiss,facebookresearch/faiss,facebookresearch/faiss,facebookresearch/faiss