Faiss

- Main Page
- Namespaces
- Classes
- Files

- File List

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
StandardGpuResources_c.cpp
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 // -*- c++ -*-
11
12 #include "gpu/StandardGpuResources_c.h"
13 #include "gpu/StandardGpuResources.h"
14 #include "macros_impl.h"
15
16 using faiss::gpu::StandardGpuResources;
17
18 DEFINE_DESTRUCTOR(StandardGpuResources)
19
20 int faiss_StandardGpuResources_new(FaissStandardGpuResources** p_res) {
21 try {
22 auto p = new StandardGpuResources();
23 *p_res = reinterpret_cast<FaissStandardGpuResources*>(p);
24 } CATCH_AND_HANDLE
25 }
26
27 int faiss_StandardGpuResources_noTempMemory(FaissStandardGpuResources* res) {
28 try {
29 reinterpret_cast<StandardGpuResources*>(res)->noTempMemory();
30 } CATCH_AND_HANDLE
31 }
32
33 int faiss_StandardGpuResources_setTempMemory(FaissStandardGpuResources* res, size_t size) {
34 try {
35 reinterpret_cast<StandardGpuResources*>(res)->setTempMemory(size);
36 } CATCH_AND_HANDLE
37 }
38
39 int faiss_StandardGpuResources_setTempMemoryFraction(FaissStandardGpuResources* res, float fraction) {
40 try {
41 reinterpret_cast<StandardGpuResources*>(res)->setTempMemoryFraction(fraction);
42 } CATCH_AND_HANDLE
43 }
44
45 int faiss_StandardGpuResources_setPinnedMemory(FaissStandardGpuResources* res, size_t size) {
46 try {
47 reinterpret_cast<StandardGpuResources*>(res)->setPinnedMemory(size);
48 } CATCH_AND_HANDLE
49 }
50
51 int faiss_StandardGpuResources_setDefaultStream(FaissStandardGpuResources* res, int device, cudaStream_t stream) {
52 try {
53 reinterpret_cast<StandardGpuResources*>(res)->setDefaultStream(device, stream);
54 } CATCH_AND_HANDLE
55 }
56
57 int faiss_StandardGpuResources_setDefaultNullStreamAllDevices(FaissStandardGpuResources* res) {
58 try {
59 reinterpret_cast<StandardGpuResources*>(res)->setDefaultNullStreamAllDevices();
60 } CATCH_AND_HANDLE
61 }
faiss::gpu::StandardGpuResources
Definition: StandardGpuResources.h:22