/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include #include #include #include #include namespace faiss { namespace gpu { // If we want to run multi-GPU, create a proxy to wrap the indices. // If we don't want multi-GPU, don't involve the proxy, so it doesn't // affect the timings. template struct IndexWrapper { std::vector> resources; std::vector> subIndex; std::unique_ptr replicaIndex; IndexWrapper( int numGpus, std::function(GpuResources*, int)> init); faiss::Index* getIndex(); void runOnIndices(std::function f); void setNumProbes(int nprobe); }; } } #include