Faiss

- Main Page
- Namespaces
- Classes
- Files

- File List

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