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