Faiss
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
faiss.h
1 
2 /**
3  * Copyright (c) 2015-present, Facebook, Inc.
4  * All rights reserved.
5  *
6  * This source code is licensed under the CC-by-NC license found in the
7  * LICENSE file in the root directory of this source tree. An additional grant
8  * of patent rights can be found in the PATENTS file in the same directory.
9  */
10 
11 // Copyright 2004-present Facebook. All Rights Reserved
12 // -*- c++ -*-
13 
14 // This is the main internal include file for Faiss. It defines
15 // macros and some machine-specific functions shared across .cpp files
16 
17 #ifndef FAISS_h
18 #define FAISS_h
19 
20 #include <stdint.h>
21 #include <stdlib.h>
22 #include <stddef.h>
23 
24 #ifndef __SSE2__
25  #error "SSE optimized distance computations not set"
26 #endif
27 
28 
29 
30 
31 #ifdef _OPENMP
32  #include <omp.h>
33  #define SET_NT(ntlim) \
34  size_t nt = omp_get_max_threads(); \
35  if (nt > ntlim) nt = ntlim;
36 #else
37  #warning "OpenMP is NOT activated"
38  #define SET_NT(ntlim) size_t nt = 0; nt++;
39 #endif
40 
41 /* This is to prevent warning by the linter (FINTEGER is defined externally) */
42 #ifndef FINTEGER
43  #define FINTEGER long
44 #endif
45 
46 #endif