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"
20
21#include <unordered_set>
22#include <array>
23
24namespace o2::gpu
25{
26
28 struct hasher {
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 {
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
int32_t i
Definitions of TPC Zero Suppression Data Headers.
StringRef key
GLuint64EXT * result
Definition glcorearb.h:5662
bool operator()(const o2::tpc::TriggerInfoDLBZS &lhs, const o2::tpc::TriggerInfoDLBZS &rhs) const
size_t operator()(const o2::tpc::TriggerInfoDLBZS &key) const
std::unordered_set< o2::tpc::TriggerInfoDLBZS, hasher, equal > triggers
Trigger info including the orbit.