Faiss
 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 // Copyright 2004-present Facebook. All Rights Reserved.
10 
11 #ifndef GPU_FAISS_ASSERT_INCLUDED
12 #define GPU_FAISS_ASSERT_INCLUDED
13 
14 #include "../FaissAssert.h"
15 #include <cuda.h>
16 
17 ///
18 /// Assertions
19 ///
20 
21 #ifdef __CUDA_ARCH__
22 #define GPU_FAISS_ASSERT(X) assert(X)
23 #define GPU_FAISS_ASSERT_MSG(X, MSG) assert(X)
24 #define GPU_FAISS_ASSERT_FMT(X, FMT, ...) assert(X)
25 #else
26 #define GPU_FAISS_ASSERT(X) FAISS_ASSERT(X)
27 #define GPU_FAISS_ASSERT_MSG(X, MSG) FAISS_ASSERT_MSG(X, MSG)
28 #define GPU_FAISS_ASSERT_FMT(X, FMT, ...) FAISS_ASSERT_FMT(X, FMT, __VA_ARGS)
29 #endif // __CUDA_ARCH__
30 
31 #endif