| 1 |
/* |
| 2 |
* Copyright (c) Meta Platforms, Inc. and 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 |
// -*- c -*- |
| 9 |
|
| 10 |
#ifndef FAISS_GPU_AUTO_TUNE_C_H |
| 11 |
#define FAISS_GPU_AUTO_TUNE_C_H |
| 12 |
|
| 13 |
#include <stddef.h> |
| 14 |
#include "../Index_c.h" |
| 15 |
#include "../faiss_c.h" |
| 16 |
#include "GpuClonerOptions_c.h" |
| 17 |
#include "GpuIndex_c.h" |
| 18 |
#include "GpuResources_c.h" |
| 19 |
|
| 20 |
#ifdef __cplusplus |
| 21 |
extern "C" { |
| 22 |
#endif |
| 23 |
|
| 24 |
/// converts any GPU index inside gpu_index to a CPU index |
| 25 |
int faiss_index_gpu_to_cpu(const FaissIndex* gpu_index, FaissIndex** p_out); |
| 26 |
|
| 27 |
/// converts any CPU index that can be converted to GPU |
| 28 |
int faiss_index_cpu_to_gpu( |
| 29 |
FaissGpuResourcesProvider* provider, |
| 30 |
int device, |
| 31 |
const FaissIndex* index, |
| 32 |
FaissGpuIndex** p_out); |
| 33 |
|
| 34 |
/// converts any CPU index that can be converted to GPU |
| 35 |
int faiss_index_cpu_to_gpu_with_options( |
| 36 |
FaissGpuResourcesProvider* provider, |
| 37 |
int device, |
| 38 |
const FaissIndex* index, |
| 39 |
const FaissGpuClonerOptions* options, |
| 40 |
FaissGpuIndex** p_out); |
| 41 |
|
| 42 |
/// converts any CPU index that can be converted to GPU |
| 43 |
int faiss_index_cpu_to_gpu_multiple( |
| 44 |
FaissGpuResourcesProvider* const* providers_vec, |
| 45 |
const int* devices, |
| 46 |
size_t devices_size, |
| 47 |
const FaissIndex* index, |
| 48 |
FaissGpuIndex** p_out); |
| 49 |
|
| 50 |
/// converts any CPU index that can be converted to GPU |
| 51 |
int faiss_index_cpu_to_gpu_multiple_with_options( |
| 52 |
FaissGpuResourcesProvider* const* providers_vec, |
| 53 |
size_t providers_vec_size, |
| 54 |
const int* devices, |
| 55 |
size_t devices_size, |
| 56 |
const FaissIndex* index, |
| 57 |
const FaissGpuMultipleClonerOptions* options, |
| 58 |
FaissGpuIndex** p_out); |
| 59 |
|
| 60 |
/// parameter space and setters for GPU indexes |
| 61 |
FAISS_DECLARE_CLASS_INHERITED(GpuParameterSpace, ParameterSpace) |
| 62 |
|
| 63 |
#ifdef __cplusplus |
| 64 |
} |
| 65 |
#endif |
| 66 |
#endif |