]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/tracking-ca/AliHLTTPCCADef.h
88fefc64c6412e5a71a9b95586b5476cd8b3c294
[u/mrichter/AliRoot.git] / HLT / TPCLib / tracking-ca / AliHLTTPCCADef.h
1 //-*- Mode: C++ -*-
2
3 //* This file is property of and copyright by the ALICE HLT Project        *
4 //* ALICE Experiment at CERN, All rights reserved.                         *
5 //* See cxx source for full Copyright notice                               *
6
7 #ifndef ALIHLTTPCCADEF_H
8 #define ALIHLTTPCCADEF_H
9
10
11 /**
12  * Definitions needed for AliHLTTPCCATracker
13  *
14  */
15
16 //#define HLTCA_STANDALONE // compilation w/o root
17 #define HLTCA_INTERNAL_PERFORMANCE
18
19 #ifdef __CUDACC__
20 #define HLTCA_GPUCODE
21 #endif
22
23 #ifdef WIN32
24 #ifndef R__WIN32
25 #define R__WIN32
26 #endif
27 #endif
28
29 #if defined(R__WIN32)
30 #ifdef INTEL_RUNTIME\r
31 #pragma warning(disable : 1786)\r
32 #pragma warning(disable : 1478)\r
33 #pragma warning(disable : 161)\r
34 #endif\r
35 \r
36 #ifdef VSNET_RUNTIME\r
37 #pragma warning(disable : 4616)\r
38 #pragma warning(disable : 4996)\r
39 #pragma warning(disable : 1684)\r
40 #endif
41 #endif
42
43 #if defined(HLTCA_STANDALONE) || defined(HLTCA_GPUCODE)
44
45 // class TObject{};
46
47 #define ClassDef(name,id)
48 #define ClassImp(name)
49
50 typedef unsigned char  UChar_t;     //Unsigned Character 1 byte (unsigned char)
51 #ifdef R__B64    // Note: Long_t and ULong_t are currently not portable types
52 typedef int            Seek_t;      //File pointer (int)
53 typedef long           Long_t;      //Signed long integer 8 bytes (long)
54 typedef unsigned long  ULong_t;     //Unsigned long integer 8 bytes (unsigned long)
55 #else
56 typedef int            Seek_t;      //File pointer (int)
57 typedef long           Long_t;      //Signed long integer 4 bytes (long)
58 typedef unsigned long  ULong_t;     //Unsigned long integer 4 bytes (unsigned long)
59 #endif
60 typedef float          Float16_t;   //Float 4 bytes written with a truncated mantissa
61 typedef double         Double32_t;  //Double 8 bytes in memory, written as a 4 bytes float
62 typedef char           Text_t;      //General string (char)
63 typedef unsigned char  Byte_t;      //Byte (8 bits) (unsigned char)
64 typedef short          Version_t;   //Class version identifier (short)
65 typedef const char     Option_t;    //Option string (const char)
66 typedef int            Ssiz_t;      //String size (int)
67 typedef float          Real_t;      //TVector and TMatrix element type (float)
68 #if defined(R__WIN32) && !defined(__CINT__)
69 typedef __int64          Long64_t;  //Portable signed long integer 8 bytes
70 typedef unsigned __int64 ULong64_t; //Portable unsigned long integer 8 bytes
71 #else
72 typedef long long          Long64_t; //Portable signed long integer 8 bytes
73 typedef unsigned long long ULong64_t;//Portable unsigned long integer 8 bytes
74 #endif
75 typedef double         Axis_t;      //Axis values type (double)
76 typedef double         Stat_t;      //Statistics type (double)
77 typedef short          Font_t;      //Font number (short)
78 typedef short          Style_t;     //Style number (short)
79 typedef short          Marker_t;    //Marker number (short)
80 typedef short          Width_t;     //Line width (short)
81 typedef short          Color_t;     //Color number (short)
82 typedef short          SCoord_t;    //Screen coordinates (short)
83 typedef double         Coord_t;     //Pad world coordinates (double)
84 typedef float          Angle_t;     //Graphics angle (float)
85 typedef float          Size_t;      //Attribute size (float)
86
87 #else
88
89 #include "Rtypes.h"
90 #include "AliHLTDataTypes.h"
91
92 namespace AliHLTTPCCADefinitions
93 {
94   extern const AliHLTComponentDataType fgkTrackletsDataType;
95 }
96
97 #endif
98
99 #ifdef HLTCA_GPUCODE
100 #define ALIHLTTPCCANEIGHBOURS_FINDER_MAX_NNEIGHUP 5
101 #define ALIHLTTPCCANEIGHBOURS_FINDER_MAX_FGRIDCONTENTUPDOWN 700
102 #define ALIHLTTPCCASTARTHITSFINDER_MAX_FROWSTARTHITS 3500
103 #define ALIHLTTPCCATRACKLET_CONSTRUCTOR_TEMP_MEM 650
104 #else
105 #define ALIHLTTPCCANEIGHBOURS_FINDER_MAX_NNEIGHUP 20
106 #define ALIHLTTPCCANEIGHBOURS_FINDER_MAX_FGRIDCONTENTUPDOWN 7000
107 #define ALIHLTTPCCASTARTHITSFINDER_MAX_FROWSTARTHITS 10000
108 #define ALIHLTTPCCATRACKLET_CONSTRUCTOR_TEMP_MEM 5000
109 #endif
110
111 #ifdef HLTCA_GPUCODE
112
113 #define GPUd() __device__
114 #define GPUhd() __host__ __device__
115 #define GPUh() __host__ inline
116 #define GPUg() __global__
117
118 #define GPUshared() __shared__
119 #define GPUsync() __syncthreads()
120
121 __constant__ float4 gAliHLTTPCCATracker[30000/sizeof( float4 )];
122
123 #else
124
125 #define GPUd()
126 #define GPUhd()
127 #define GPUg()
128 #define GPUh()
129 #define GPUshared()
130 #define GPUsync()
131
132 struct float2 { float x; float y; };
133 struct uchar2 { unsigned char x; unsigned char y; };
134 struct ushort2 { unsigned short x; unsigned short y; };
135 struct uint1 { unsigned int x; };
136 struct uint4 { unsigned int x, y, z, w; };
137
138 #ifdef R__WIN32
139 #include <float.h>
140
141 inline bool finite(float x)
142 {
143         return(x <= FLT_MAX);
144 }
145 #endif
146
147 #endif
148
149 /*
150  * Helper for compile-time verification of correct API usage
151  */
152 namespace
153 {
154   template<bool> struct HLTTPCCA_STATIC_ASSERT_FAILURE;
155   template<> struct HLTTPCCA_STATIC_ASSERT_FAILURE<true> {};
156 }
157
158 #define HLTTPCCA_STATIC_ASSERT_CONCAT_HELPER(a, b) a##b
159 #define HLTTPCCA_STATIC_ASSERT_CONCAT(a, b) HLTTPCCA_STATIC_ASSERT_CONCAT_HELPER(a, b)
160 #define STATIC_ASSERT(cond, msg) \
161   typedef HLTTPCCA_STATIC_ASSERT_FAILURE<cond> HLTTPCCA_STATIC_ASSERT_CONCAT(_STATIC_ASSERTION_FAILED_##msg, __LINE__); \
162   HLTTPCCA_STATIC_ASSERT_CONCAT(_STATIC_ASSERTION_FAILED_##msg, __LINE__) Error_##msg; \
163   (void) Error_##msg
164
165 namespace
166 {
167   template<typename T1>
168   void UNUSED_PARAM1( const T1 & ) {}
169   template<typename T1, typename T2>
170   void UNUSED_PARAM2( const T1 &, const T2 & ) {}
171   template<typename T1, typename T2, typename T3>
172   void UNUSED_PARAM3( const T1 &, const T2 &, const T3 & ) {}
173   template<typename T1, typename T2, typename T3, typename T4>
174   void UNUSED_PARAM4( const T1 &, const T2 &, const T3 &, const T4 & ) {}
175   template<typename T1, typename T2, typename T3, typename T4, typename T5>
176   void UNUSED_PARAM5( const T1 &, const T2 &, const T3 &, const T4 &, const T5 & ) {}
177   template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
178   void UNUSED_PARAM6( const T1 &, const T2 &, const T3 &, const T4 &, const T5 &, const T6 & ) {}
179   template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
180   void UNUSED_PARAM7( const T1 &, const T2 &, const T3 &, const T4 &, const T5 &, const T6 &, const T7 & ) {}
181   template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
182   void UNUSED_PARAM8( const T1 &, const T2 &, const T3 &, const T4 &, const T5 &, const T6 &, const T7 &, const T8 & ) {}
183   template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
184   void UNUSED_PARAM9( const T1 &, const T2 &, const T3 &, const T4 &, const T5 &, const T6 &, const T7 &, const T8 &, const T9 & ) {}
185 }
186
187 #endif