Faiss

- Main Page
- Namespaces
- Classes
- Files

- File List

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 // Copyright 2004-present Facebook. All Rights Reserved.
10 #pragma once
11
12 #include "../Index.h"
13 #include "../AutoTune.h"
14 #include "GpuClonerOptions.h"
15 #include "GpuIndex.h"
16 #include "GpuIndicesOptions.h"
17
18 namespace faiss { namespace gpu {
19
20 class GpuResources;
21
22 // to support auto-tuning we need cloning to/from CPU
23
24 /// converts any GPU index inside gpu_index to a CPU index
25 faiss::Index * index_gpu_to_cpu(const faiss::Index *gpu_index);
26
27 /// converts any CPU index that can be converted to GPU
28 faiss::Index * index_cpu_to_gpu(
29 GpuResources* resources, int device,
30 const faiss::Index *index,
31 const GpuClonerOptions *options = nullptr);
32
33 faiss::Index * index_cpu_to_gpu_multiple(
34 std::vector<GpuResources*> & resources,
35 std::vector<int> &devices,
36 const faiss::Index *index,
37 const GpuMultipleClonerOptions *options = nullptr);
38
39 /// parameter space and setters for GPU indexes
40 struct GpuParameterSpace: faiss::ParameterSpace {
41 /// initialize with reasonable parameters for the index
42 void initialize (const faiss::Index * index) override;
43
44 /// set a combination of parameters on an index
45 void set_index_parameter (
46 faiss::Index * index, const std::string & name,
47 double val) const override;
48 };
49
50 } } // namespace
faiss::gpu::GpuParameterSpace::initialize
void initialize(const faiss::Index *index) override
initialize with reasonable parameters for the index
Definition: GpuAutoTune.cpp:343
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:376
faiss::gpu::GpuParameterSpace
parameter space and setters for GPU indexes
Definition: GpuAutoTune.h:40
faiss::ParameterSpace
Definition: AutoTune.h:132
faiss::Index
Definition: Index.h:60