Faiss
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
GpuAutoTune.h
1 /**
2  * Copyright (c) 2015-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD+Patents license found in the
6  * LICENSE file in the root directory of this source tree.
7  */
8 
9 #pragma once
10 
11 #include "../Index.h"
12 #include "../AutoTune.h"
13 #include "GpuClonerOptions.h"
14 #include "GpuIndex.h"
15 #include "GpuIndicesOptions.h"
16 
17 namespace faiss { namespace gpu {
18 
19 class GpuResources;
20 
21 // to support auto-tuning we need cloning to/from CPU
22 
23 /// converts any GPU index inside gpu_index to a CPU index
24 faiss::Index * index_gpu_to_cpu(const faiss::Index *gpu_index);
25 
26 /// converts any CPU index that can be converted to GPU
27 faiss::Index * index_cpu_to_gpu(
28  GpuResources* resources, int device,
29  const faiss::Index *index,
30  const GpuClonerOptions *options = nullptr);
31 
32 faiss::Index * index_cpu_to_gpu_multiple(
33  std::vector<GpuResources*> & resources,
34  std::vector<int> &devices,
35  const faiss::Index *index,
36  const GpuMultipleClonerOptions *options = nullptr);
37 
38 /// parameter space and setters for GPU indexes
40  /// initialize with reasonable parameters for the index
41  void initialize (const faiss::Index * index) override;
42 
43  /// set a combination of parameters on an index
44  void set_index_parameter (
45  faiss::Index * index, const std::string & name,
46  double val) const override;
47 };
48 
49 } } // namespace
void initialize(const faiss::Index *index) override
initialize with reasonable parameters for the index
void set_index_parameter(faiss::Index *index, const std::string &name, double val) const override
set a combination of parameters on an index
parameter space and setters for GPU indexes
Definition: GpuAutoTune.h:39