Debian Codegraph @

c_api/gpu/GpuClonerOptions_c.cpp

raw
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 #include "GpuClonerOptions_c.h"
11 #include <faiss/gpu/GpuClonerOptions.h>
12 #include "macros_impl.h"
13
14 using faiss::gpu::GpuClonerOptions;
15 using faiss::gpu::GpuMultipleClonerOptions;
16 using faiss::gpu::IndicesOptions;
17
18 int faiss_GpuClonerOptions_new(FaissGpuClonerOptions** p) {
19 try {
20 *p = reinterpret_cast<FaissGpuClonerOptions*>(new GpuClonerOptions());
21 }
22 CATCH_AND_HANDLE
23 }
24
25 int faiss_GpuMultipleClonerOptions_new(FaissGpuMultipleClonerOptions** p) {
26 try {
27 *p = reinterpret_cast<FaissGpuMultipleClonerOptions*>(
28 new GpuMultipleClonerOptions());
29 }
30 CATCH_AND_HANDLE
31 }
32
33 DEFINE_DESTRUCTOR(GpuClonerOptions)
34 DEFINE_DESTRUCTOR(GpuMultipleClonerOptions)
35
36 DEFINE_GETTER(GpuClonerOptions, FaissIndicesOptions, indicesOptions)
37 DEFINE_GETTER(GpuClonerOptions, int, useFloat16CoarseQuantizer)
38 DEFINE_GETTER(GpuClonerOptions, int, useFloat16)
39 DEFINE_GETTER(GpuClonerOptions, int, usePrecomputed)
40 DEFINE_GETTER(GpuClonerOptions, long, reserveVecs)
41 DEFINE_GETTER(GpuClonerOptions, int, storeTransposed)
42 DEFINE_GETTER(GpuClonerOptions, int, verbose)
43 DEFINE_GETTER(GpuMultipleClonerOptions, int, shard)
44 DEFINE_GETTER(GpuMultipleClonerOptions, int, shard_type)
45
46 DEFINE_SETTER_STATIC(
47 GpuClonerOptions,
48 IndicesOptions,
49 FaissIndicesOptions,
50 indicesOptions)
51 DEFINE_SETTER_STATIC(GpuClonerOptions, bool, int, useFloat16CoarseQuantizer)
52 DEFINE_SETTER_STATIC(GpuClonerOptions, bool, int, useFloat16)
53 DEFINE_SETTER_STATIC(GpuClonerOptions, bool, int, usePrecomputed)
54 DEFINE_SETTER(GpuClonerOptions, long, reserveVecs)
55 DEFINE_SETTER_STATIC(GpuClonerOptions, bool, int, storeTransposed)
56 DEFINE_SETTER_STATIC(GpuClonerOptions, bool, int, verbose)
57 DEFINE_SETTER_STATIC(GpuMultipleClonerOptions, bool, int, shard)
58 DEFINE_SETTER(GpuMultipleClonerOptions, int, shard_type)