Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions DataFormats/Detectors/TPC/include/DataFormatsTPC/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#ifndef AliceO2_TPC_Constants_H
#define AliceO2_TPC_Constants_H

#include "GPUCommonDef.h"

namespace o2
{
namespace tpc
Expand All @@ -25,17 +27,17 @@ namespace constants
{

// the number of sectors
constexpr int MAXSECTOR = 36;
GPUglobalconstexpr() int MAXSECTOR = 36;

// the number of global pad rows
#if defined(GPUCA_STANDALONE) && defined(GPUCA_RUN2)
constexpr int MAXGLOBALPADROW = 159; // Number of pad rows in Run 2, used for GPU TPC tests with Run 2 data
GPUglobalconstexpr() int MAXGLOBALPADROW = 159; // Number of pad rows in Run 2, used for GPU TPC tests with Run 2 data
#else
constexpr int MAXGLOBALPADROW = 152; // Correct number of pad rows in Run 3
GPUglobalconstexpr() int MAXGLOBALPADROW = 152; // Correct number of pad rows in Run 3
#endif

// number of LHC bunch crossings per TPC time bin (40 MHz / 5 MHz)
constexpr int LHCBCPERTIMEBIN = 8;
GPUglobalconstexpr() int LHCBCPERTIMEBIN = 8;
} // namespace constants
} // namespace tpc
} // namespace o2
Expand Down
7 changes: 6 additions & 1 deletion GPU/Common/GPUCommonDefAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#define GPUglobal() // global memory variable declaration (only used for kernel input pointers)
#define GPUconstant() // constant memory variable declaraion
#define GPUconstexpr() static constexpr // constexpr on GPU that needs to be instantiated for dynamic access (e.g. arrays), becomes __constant on GPU
#define GPUglobalconstexpr() constexpr // constexpr variable at program scope, needs the constant address space in MSL
#define GPUprivate() // private memory variable declaration
#define GPUgeneric() // reference / ptr to generic address space
#define GPUbarrier() // synchronize all GPU threads in block
Expand Down Expand Up @@ -160,6 +161,7 @@
#define GPUglobal() device
#define GPUconstant() constant // TODO: possibly add const __restrict where possible later!
#define GPUconstexpr() constant
#define GPUglobalconstexpr() constant constexpr
#define GPUprivate() thread
#define GPUgeneric()
#define GPUglobalref() device
Expand Down Expand Up @@ -255,6 +257,9 @@
#ifndef GPUconstexprref
#define GPUconstexprref()
#endif
#ifndef GPUglobalconstexpr
#define GPUglobalconstexpr() constexpr
#endif

#define GPUrestrict() __restrict__

Expand All @@ -277,5 +282,5 @@
#define get_group_id(dim) iBlock
#endif

// clang-format on
// clang-format on
#endif