//-*- Mode: C++ -*-
-//* This file is property of and copyright by the ALICE HLT Project *
+//* This file is property of and copyright by the ALICE HLT Project *
//* ALICE Experiment at CERN, All rights reserved. *
//* See cxx source for full Copyright notice *
#ifndef ALIHLTTPCCADEF_H
#define ALIHLTTPCCADEF_H
-
+
/**
* Definitions needed for AliHLTTPCCATracker
*
- */
-
+ */
+
//#define HLTCA_STANDALONE // compilation w/o root
+#define HLTCA_INTERNAL_PERFORMANCE
#ifdef __CUDACC__
-
#define HLTCA_GPUCODE
+#endif
+#ifdef WIN32
+#ifndef R__WIN32
+#define R__WIN32
+#endif
+#endif
+
+#if defined(R__WIN32)
+#ifdef INTEL_RUNTIME\r
+#pragma warning(disable : 1786)\r
+#pragma warning(disable : 1478)\r
+#pragma warning(disable : 161)\r
+#endif\r
+\r
+#ifdef VSNET_RUNTIME\r
+#pragma warning(disable : 4616)\r
+#pragma warning(disable : 4996)\r
+#pragma warning(disable : 1684)\r
+#endif
#endif
-#if defined(HLTCA_STANDALONE) || defined(HLTCA_GPUCODE)
+#if defined(HLTCA_STANDALONE)
-class TObject{};
+// class TObject{};
+
+#ifdef ClassDef
+#undef ClassDef
+#endif
+
+#ifdef ClassTmp
+#undef ClassTmp
+#endif
#define ClassDef(name,id)
#define ClassImp(name)
-typedef char Char_t; //Signed Character 1 byte (char)
typedef unsigned char UChar_t; //Unsigned Character 1 byte (unsigned char)
-typedef short Short_t; //Signed Short integer 2 bytes (short)
-typedef unsigned short UShort_t; //Unsigned Short integer 2 bytes (unsigned short)
-#ifdef R__INT16
-typedef long Int_t; //Signed integer 4 bytes
-typedef unsigned long UInt_t; //Unsigned integer 4 bytes
-#else
-typedef int Int_t; //Signed integer 4 bytes (int)
-typedef unsigned int UInt_t; //Unsigned integer 4 bytes (unsigned int)
-#endif
#ifdef R__B64 // Note: Long_t and ULong_t are currently not portable types
typedef int Seek_t; //File pointer (int)
typedef long Long_t; //Signed long integer 8 bytes (long)
typedef long Long_t; //Signed long integer 4 bytes (long)
typedef unsigned long ULong_t; //Unsigned long integer 4 bytes (unsigned long)
#endif
-typedef float Float_t; //Float 4 bytes (float)
typedef float Float16_t; //Float 4 bytes written with a truncated mantissa
-typedef double Double_t; //Double 8 bytes
typedef double Double32_t; //Double 8 bytes in memory, written as a 4 bytes float
typedef char Text_t; //General string (char)
-typedef bool Bool_t; //Boolean (0=false, 1=true) (bool)
typedef unsigned char Byte_t; //Byte (8 bits) (unsigned char)
typedef short Version_t; //Class version identifier (short)
typedef const char Option_t; //Option string (const char)
typedef float Angle_t; //Graphics angle (float)
typedef float Size_t; //Attribute size (float)
-#else
+#else
#include "Rtypes.h"
-#include "TObject.h"
+#include "AliHLTDataTypes.h"
+
+namespace AliHLTTPCCADefinitions
+{
+ extern const AliHLTComponentDataType fgkTrackletsDataType;
+ extern const AliHLTComponentDataType fgkCompressedInputDataType;
+}
#endif
+//#define EXTERN_ROW_HITS
+#define TRACKLET_SELECTOR_MIN_HITS 10
+#define REPRODUCIBLE_CLUSTER_SORTING
+#ifdef HLTCA_GPUCODE
+#define ALIHLTTPCCANEIGHBOURS_FINDER_MAX_NNEIGHUP 6
+#define ALIHLTTPCCANEIGHBOURS_FINDER_MAX_FGRIDCONTENTUPDOWN 1000
+#define ALIHLTTPCCASTARTHITSFINDER_MAX_FROWSTARTHITS 3500
+#define ALIHLTTPCCATRACKLET_CONSTRUCTOR_TEMP_MEM 1536 //Max amount of hits in a row that can be stored in shared memory, make sure this is divisible by ROW ALIGNMENT
+#else
+#define ALIHLTTPCCANEIGHBOURS_FINDER_MAX_NNEIGHUP 20
+#define ALIHLTTPCCANEIGHBOURS_FINDER_MAX_FGRIDCONTENTUPDOWN 7000
+#define ALIHLTTPCCASTARTHITSFINDER_MAX_FROWSTARTHITS 10000
+#define ALIHLTTPCCATRACKLET_CONSTRUCTOR_TEMP_MEM 15000
+#endif
#ifdef HLTCA_GPUCODE
-#define GPUd() __device__
-#define GPUhd() __host__ __device__
-#define GPUh() __host__ inline
-#define GPUg() __global__
+#define GPUd() __device__
+#define GPUhd() __host__ __device__
+#define GPUh() __host__ inline
+#define GPUg() __global__
-#define GPUshared() __shared__
+#define GPUshared() __shared__
#define GPUsync() __syncthreads()
-__constant__ float4 cTracker[30000/sizeof(float4)];
-
#else
-#define GPUd()
+#define GPUd()
#define GPUhd()
#define GPUg()
-#define GPUh()
-#define GPUshared()
-#define GPUsync()
-
-struct float2{ float x; float y; };
-struct uchar2{ unsigned char x; unsigned char y; };
-struct ushort2{ unsigned short x; unsigned short y; };
-struct uint1{ unsigned int x; };
-struct uint4{ unsigned int x,y,z,w; };
-
-float2 inline make_float2(float x, float y ){
- float2 ret = {x,y};
- return ret;
+#define GPUh()
+#define GPUshared()
+#define GPUsync()
+
+struct float2 { float x; float y; };
+struct uchar2 { unsigned char x, y; };
+struct short2 { short x, y; };
+struct ushort2 { unsigned short x, y; };
+struct int2 { int x, y; };
+struct int3 { int x, y, z; };
+struct int4 { int x, y, z, w; };
+struct uint1 { unsigned int x; };
+struct uint2 { unsigned int x, y; };
+struct uint3 { unsigned int x, y, z; };
+struct uint4 { unsigned int x, y, z, w; };
+
+#ifdef R__WIN32
+#include <float.h>
+
+inline bool finite(float x)
+{
+ return(x <= FLT_MAX);
}
+#endif
#endif
+/*
+ * Helper for compile-time verification of correct API usage
+ */
+
+#ifndef HLTCA_GPUCODE
+namespace
+{
+ template<bool> struct HLTTPCCA_STATIC_ASSERT_FAILURE;
+ template<> struct HLTTPCCA_STATIC_ASSERT_FAILURE<true> {};
+}
+
+#define HLTTPCCA_STATIC_ASSERT_CONCAT_HELPER(a, b) a##b
+#define HLTTPCCA_STATIC_ASSERT_CONCAT(a, b) HLTTPCCA_STATIC_ASSERT_CONCAT_HELPER(a, b)
+#define STATIC_ASSERT(cond, msg) \
+ typedef HLTTPCCA_STATIC_ASSERT_FAILURE<cond> HLTTPCCA_STATIC_ASSERT_CONCAT(_STATIC_ASSERTION_FAILED_##msg, __LINE__); \
+ HLTTPCCA_STATIC_ASSERT_CONCAT(_STATIC_ASSERTION_FAILED_##msg, __LINE__) Error_##msg; \
+ (void) Error_##msg
+#else
+#define STATIC_ASSERT(a, b)
+#endif
+
+namespace
+{
+ template<typename T1>
+ void UNUSED_PARAM1( const T1 & ) {}
+ template<typename T1, typename T2>
+ void UNUSED_PARAM2( const T1 &, const T2 & ) {}
+ template<typename T1, typename T2, typename T3>
+ void UNUSED_PARAM3( const T1 &, const T2 &, const T3 & ) {}
+ template<typename T1, typename T2, typename T3, typename T4>
+ void UNUSED_PARAM4( const T1 &, const T2 &, const T3 &, const T4 & ) {}
+ template<typename T1, typename T2, typename T3, typename T4, typename T5>
+ void UNUSED_PARAM5( const T1 &, const T2 &, const T3 &, const T4 &, const T5 & ) {}
+ template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
+ void UNUSED_PARAM6( const T1 &, const T2 &, const T3 &, const T4 &, const T5 &, const T6 & ) {}
+ template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
+ void UNUSED_PARAM7( const T1 &, const T2 &, const T3 &, const T4 &, const T5 &, const T6 &, const T7 & ) {}
+ template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
+ void UNUSED_PARAM8( const T1 &, const T2 &, const T3 &, const T4 &, const T5 &, const T6 &, const T7 &, const T8 & ) {}
+ template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
+ void UNUSED_PARAM9( const T1 &, const T2 &, const T3 &, const T4 &, const T5 &, const T6 &, const T7 &, const T8 &, const T9 & ) {}
+}
+
+#define UNROLL2(var, code) code;var++;code;var++;
+#define UNROLL4(var, code) UNROLL2(var, code) UNROLL2(var, code)
+#define UNROLL8(var, code) UNROLL4(var, code) UNROLL4(var, code)
+#define UNROLL16(var, code) UNROLL8(var, code) UNROLL8(var, code)
+#define UNROLL32(var, code) UNROLL16(var, code) UNROLL16(var, code)
#endif