2017-11-22 05:10:35 -08:00
|
|
|
/**
|
2019-05-28 16:17:22 +02:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2017-11-22 05:10:35 -08:00
|
|
|
*
|
2019-05-28 16:17:22 +02:00
|
|
|
* This source code is licensed under the MIT license found in the
|
2017-11-22 05:10:35 -08:00
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef GPU_FAISS_ASSERT_INCLUDED
|
|
|
|
#define GPU_FAISS_ASSERT_INCLUDED
|
|
|
|
|
2019-09-20 18:59:10 +02:00
|
|
|
#include <faiss/impl/FaissAssert.h>
|
2017-11-22 05:10:35 -08:00
|
|
|
#include <cuda.h>
|
|
|
|
|
|
|
|
///
|
|
|
|
/// Assertions
|
|
|
|
///
|
|
|
|
|
|
|
|
#ifdef __CUDA_ARCH__
|
|
|
|
#define GPU_FAISS_ASSERT(X) assert(X)
|
|
|
|
#define GPU_FAISS_ASSERT_MSG(X, MSG) assert(X)
|
|
|
|
#define GPU_FAISS_ASSERT_FMT(X, FMT, ...) assert(X)
|
|
|
|
#else
|
|
|
|
#define GPU_FAISS_ASSERT(X) FAISS_ASSERT(X)
|
|
|
|
#define GPU_FAISS_ASSERT_MSG(X, MSG) FAISS_ASSERT_MSG(X, MSG)
|
|
|
|
#define GPU_FAISS_ASSERT_FMT(X, FMT, ...) FAISS_ASSERT_FMT(X, FMT, __VA_ARGS)
|
|
|
|
#endif // __CUDA_ARCH__
|
|
|
|
|
|
|
|
#endif
|