Project
Loading...
Searching...
No Matches
GPUTriggerOutputs.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 GPUTRIGGEROUTPUTS_H
16
#define GPUTRIGGEROUTPUTS_H
17
18
#include "
GPUCommonDef.h
"
19
#include "
DataFormatsTPC/ZeroSuppression.h
"
20
21
#include <unordered_set>
22
#include <array>
23
24
namespace
o2::gpu
25
{
26
27
struct
GPUTriggerOutputs
{
28
struct
hasher
{
29
size_t
operator()
(
const
o2::tpc::TriggerInfoDLBZS
&
key
)
const
30
{
31
std::array<uint32_t,
sizeof
(
key
) /
sizeof
(uint32_t)> tmp;
32
memcpy((
void
*)tmp.data(), (
const
void
*)&
key
,
sizeof
(
key
));
33
std::hash<uint32_t> std_hasher;
34
size_t
result
= 0;
35
for
(
size_t
i
= 0;
i
< tmp.size(); ++
i
) {
36
result
^= std_hasher(tmp[
i
]);
37
}
38
return
result
;
39
}
40
};
41
42
struct
equal
{
43
bool
operator()
(
const
o2::tpc::TriggerInfoDLBZS
& lhs,
const
o2::tpc::TriggerInfoDLBZS
& rhs)
const
44
{
45
return
memcmp((
const
void
*)&lhs, (
const
void
*)&rhs,
sizeof
(lhs)) == 0;
46
}
47
};
48
49
std::unordered_set<o2::tpc::TriggerInfoDLBZS, hasher, equal>
triggers
;
50
static_assert
(
sizeof
(
o2::tpc::TriggerInfoDLBZS
) %
sizeof
(uint32_t) == 0);
51
};
52
53
}
// namespace o2::gpu
54
55
#endif
i
int32_t i
Definition
GPUCommonAlgorithm.h:443
GPUCommonDef.h
ZeroSuppression.h
Definitions of TPC Zero Suppression Data Headers.
key
StringRef key
Definition
catch_amalgamated.cxx:4853
result
GLuint64EXT * result
Definition
glcorearb.h:5662
o2::gpu
Definition
TrackTRD.h:35
o2::gpu::GPUTriggerOutputs::equal
Definition
GPUTriggerOutputs.h:42
o2::gpu::GPUTriggerOutputs::equal::operator()
bool operator()(const o2::tpc::TriggerInfoDLBZS &lhs, const o2::tpc::TriggerInfoDLBZS &rhs) const
Definition
GPUTriggerOutputs.h:43
o2::gpu::GPUTriggerOutputs::hasher
Definition
GPUTriggerOutputs.h:28
o2::gpu::GPUTriggerOutputs::hasher::operator()
size_t operator()(const o2::tpc::TriggerInfoDLBZS &key) const
Definition
GPUTriggerOutputs.h:29
o2::gpu::GPUTriggerOutputs
Definition
GPUTriggerOutputs.h:27
o2::gpu::GPUTriggerOutputs::triggers
std::unordered_set< o2::tpc::TriggerInfoDLBZS, hasher, equal > triggers
Definition
GPUTriggerOutputs.h:49
o2::tpc::TriggerInfoDLBZS
Trigger info including the orbit.
Definition
ZeroSuppression.h:110
GPU
GPUTracking
DataTypes
GPUTriggerOutputs.h
Generated on Tue Feb 25 2025 17:03:25 for Project by
1.9.8