Faiss

- Main Page
- Namespaces
- Classes
- Files

- File List

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
GpuFaissAssert.h
1 /**
2 * Copyright (c) 2015-present, Facebook, Inc.
3 * All rights reserved.
4 *
5 * This source code is licensed under the BSD+Patents license found in the
6 * LICENSE file in the root directory of this source tree.
7 */
8
9
10 #ifndef GPU_FAISS_ASSERT_INCLUDED
11 #define GPU_FAISS_ASSERT_INCLUDED
12
13 #include "../FaissAssert.h"
14 #include <cuda.h>
15
16 ///
17 /// Assertions
18 ///
19
20 #ifdef __CUDA_ARCH__
21 #define GPU_FAISS_ASSERT(X) assert(X)
22 #define GPU_FAISS_ASSERT_MSG(X, MSG) assert(X)
23 #define GPU_FAISS_ASSERT_FMT(X, FMT, ...) assert(X)
24 #else
25 #define GPU_FAISS_ASSERT(X) FAISS_ASSERT(X)
26 #define GPU_FAISS_ASSERT_MSG(X, MSG) FAISS_ASSERT_MSG(X, MSG)
27 #define GPU_FAISS_ASSERT_FMT(X, FMT, ...) FAISS_ASSERT_FMT(X, FMT, __VA_ARGS)
28 #endif // __CUDA_ARCH__
29
30 #endif