1
0
mirror of https://github.com/facebookresearch/faiss.git synced 2025-06-03 21:54:02 +08:00
faiss/gpu/GpuResources.cpp

53 lines
1.1 KiB
C++
Raw Normal View History

2017-02-22 23:26:44 +01:00
/**
* Copyright (c) Facebook, Inc. and its affiliates.
2017-02-22 23:26:44 +01:00
*
* This source code is licensed under the MIT license found in the
2017-02-22 23:26:44 +01:00
* LICENSE file in the root directory of this source tree.
*/
#include <faiss/gpu/GpuResources.h>
#include <faiss/gpu/utils/DeviceUtils.h>
2017-02-22 23:26:44 +01:00
namespace faiss { namespace gpu {
GpuResources::~GpuResources() {
}
cublasHandle_t
GpuResources::getBlasHandleCurrentDevice() {
return getBlasHandle(getCurrentDevice());
}
cudaStream_t
GpuResources::getDefaultStreamCurrentDevice() {
return getDefaultStream(getCurrentDevice());
}
std::vector<cudaStream_t>
GpuResources::getAlternateStreamsCurrentDevice() {
return getAlternateStreams(getCurrentDevice());
}
DeviceMemory&
GpuResources::getMemoryManagerCurrentDevice() {
return getMemoryManager(getCurrentDevice());
}
cudaStream_t
GpuResources::getAsyncCopyStreamCurrentDevice() {
return getAsyncCopyStream(getCurrentDevice());
}
void
GpuResources::syncDefaultStream(int device) {
CUDA_VERIFY(cudaStreamSynchronize(getDefaultStream(device)));
}
void
GpuResources::syncDefaultStreamCurrentDevice() {
syncDefaultStream(getCurrentDevice());
}
2017-02-22 23:26:44 +01:00
} } // namespace