Project
Loading...
Searching...
No Matches
GPUCommonArray.h
Go to the documentation of this file.
1
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3
// All rights not expressly granted are reserved.
4
//
5
// This software is distributed under the terms of the GNU General Public
6
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7
//
8
// In applying this license CERN does not waive the privileges and immunities
9
// granted to it by virtue of its status as an Intergovernmental Organization
10
// or submit itself to any jurisdiction.
11
14
15
#ifndef GPUCOMMONARRAY_H
16
#define GPUCOMMONARRAY_H
17
18
#if !defined(GPUCA_GPUCODE_DEVICE) || defined(__CUDACC__) || defined(__HIPCC__)
// TODO: Get rid of GPUCommonArray once OpenCL supports <array>
19
#ifndef GPUCA_GPUCODE_COMPILEKERNELS
20
#include <array>
21
#endif
22
#else
23
24
#include "
GPUCommonDef.h
"
25
namespace
std
26
{
27
#ifdef __METAL__
28
using ::array;
29
#elif defined(GPUCA_GPUCODE_DEVICE)
30
template
<
typename
T,
size_t
N>
31
struct
array
{
32
GPUd
() T& operator[](
size_t
i
) {
return
m_internal_V__[
i
]; };
33
GPUd
() const T& operator[](
size_t
i
)
const
{
return
m_internal_V__[
i
]; };
34
GPUd
() T*
data
() {
return
m_internal_V__; };
35
GPUd
() const T*
data
()
const
{
return
m_internal_V__; };
36
GPUd
()
void
fill(const T& t)
37
{
38
for
(
size_t
i
{0};
i
< N; ++
i
) {
39
m_internal_V__[
i
] = t;
40
}
41
}
42
T
m_internal_V__[N];
43
};
44
template
<
class
T
,
class
... E>
45
GPUd
()
array
(T, E...)->
array
<T, 1 + sizeof...(E)>;
46
#else
47
template
<
typename
T,
size_t
N>
48
using
array
= std::array<T, N>;
49
#endif
50
}
// namespace std
51
#endif
52
53
#endif
// GPUCOMMONARRAY_H
i
int32_t i
Definition
GPUCommonAlgorithm.h:451
GPUd
#define GPUd()
Definition
GPUCommonDefAPI.h:31
GPUCommonDef.h
array
GLenum array
Definition
glcorearb.h:4274
data
GLboolean * data
Definition
glcorearb.h:298
void
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
o2::math_utils::detail::T
T
Definition
SMatrixGPU.h:749
std
Definition
CcdbObjectInfo.h:121
GPU
Common
GPUCommonArray.h
Generated on Fri Oct 2 2026 18:34:54 for Project by
1.9.8