Faiss

- Main Page
- Namespaces
- Classes
- Files

- File List

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