mirror of
https://github.com/facebookresearch/faiss.git
synced 2025-06-03 21:54:02 +08:00
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3966 This actually enables the linting. Manual changes: - tools/arcanist/lint/fbsource-licenselint-config.toml - tools/arcanist/lint/fbsource-lint-engine.toml Automated changes: `arc lint --apply-patches --take LICENSELINT --paths-cmd 'hg files faiss'` Reviewed By: asadoughi Differential Revision: D64484165 fbshipit-source-id: 4f2f6e953c94ef6ebfea8a5ae035ccfbea65ed04
70 lines
1.8 KiB
C++
70 lines
1.8 KiB
C++
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
// -*- c++ -*-
|
|
|
|
#include "StandardGpuResources_c.h"
|
|
#include <faiss/gpu/StandardGpuResources.h>
|
|
#include "macros_impl.h"
|
|
|
|
using faiss::gpu::StandardGpuResources;
|
|
|
|
DEFINE_DESTRUCTOR(StandardGpuResources)
|
|
|
|
int faiss_StandardGpuResources_new(FaissStandardGpuResources** p_res) {
|
|
try {
|
|
auto p = new StandardGpuResources();
|
|
*p_res = reinterpret_cast<FaissStandardGpuResources*>(p);
|
|
}
|
|
CATCH_AND_HANDLE
|
|
}
|
|
|
|
int faiss_StandardGpuResources_noTempMemory(FaissStandardGpuResources* res) {
|
|
try {
|
|
reinterpret_cast<StandardGpuResources*>(res)->noTempMemory();
|
|
}
|
|
CATCH_AND_HANDLE
|
|
}
|
|
|
|
int faiss_StandardGpuResources_setTempMemory(
|
|
FaissStandardGpuResources* res,
|
|
size_t size) {
|
|
try {
|
|
reinterpret_cast<StandardGpuResources*>(res)->setTempMemory(size);
|
|
}
|
|
CATCH_AND_HANDLE
|
|
}
|
|
|
|
int faiss_StandardGpuResources_setPinnedMemory(
|
|
FaissStandardGpuResources* res,
|
|
size_t size) {
|
|
try {
|
|
reinterpret_cast<StandardGpuResources*>(res)->setPinnedMemory(size);
|
|
}
|
|
CATCH_AND_HANDLE
|
|
}
|
|
|
|
int faiss_StandardGpuResources_setDefaultStream(
|
|
FaissStandardGpuResources* res,
|
|
int device,
|
|
cudaStream_t stream) {
|
|
try {
|
|
reinterpret_cast<StandardGpuResources*>(res)->setDefaultStream(
|
|
device, stream);
|
|
}
|
|
CATCH_AND_HANDLE
|
|
}
|
|
|
|
int faiss_StandardGpuResources_setDefaultNullStreamAllDevices(
|
|
FaissStandardGpuResources* res) {
|
|
try {
|
|
reinterpret_cast<StandardGpuResources*>(res)
|
|
->setDefaultNullStreamAllDevices();
|
|
}
|
|
CATCH_AND_HANDLE
|
|
}
|