Faiss

- Main Page
- Namespaces
- Classes
- Files

- File List

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
GpuResources.cpp
1
2 /**
3 * Copyright (c) 2015-present, Facebook, Inc.
4 * All rights reserved.
5 *
6 * This source code is licensed under the CC-by-NC license found in the
7 * LICENSE file in the root directory of this source tree.
8 */
9
10 // Copyright 2004-present Facebook. All Rights Reserved.
11
12 #include "GpuResources.h"
13 #include "utils/DeviceUtils.h"
14
15 namespace faiss { namespace gpu {
16
17 GpuResources::~GpuResources() {
18 }
19
20 cublasHandle_t
21 GpuResources::getBlasHandleCurrentDevice() {
22 return getBlasHandle(getCurrentDevice());
23 }
24
25 cudaStream_t
26 GpuResources::getDefaultStreamCurrentDevice() {
27 return getDefaultStream(getCurrentDevice());
28 }
29
30 std::vector<cudaStream_t>
31 GpuResources::getAlternateStreamsCurrentDevice() {
32 return getAlternateStreams(getCurrentDevice());
33 }
34
35 DeviceMemory&
36 GpuResources::getMemoryManagerCurrentDevice() {
37 return getMemoryManager(getCurrentDevice());
38 }
39
40 cudaStream_t
41 GpuResources::getAsyncCopyStreamCurrentDevice() {
42 return getAsyncCopyStream(getCurrentDevice());
43 }
44
45 } } // namespace