ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
ISF
ISF_FastCaloSim
ISF_FastCaloGpu
ISF_FastCaloGpu
Identifier_g.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef ISF_FASTCALOGPU_Identifier_GPU
6
#define ISF_FASTCALOGPU_Identifier_GPU
7
8
9
# ifdef __CUDACC__
10
# define CUDA_HOSTDEV __host__ __device__
11
# else
12
# define CUDA_HOSTDEV
13
# endif
14
15
class
Identifier_Gpu
{
16
public
:
17
typedef
long
long
value_type
;
18
19
typedef
enum
bit_defs_enum
{
20
NBITS
=
sizeof
(
value_type
) * 8,
// bits per byte
21
MAX_BIT
= (
static_cast<
value_type
>
( 1 ) << (
NBITS
- 1 ) ),
22
ALL_BITS
= ~(
static_cast<
value_type
>
( 0 ) )
23
}
bit_defs
;
24
25
typedef
enum
max_value_type_enum
{
26
// max_value = 0xFFFFFFFFFFFFFFFFULL
27
max_value
= ~(
static_cast<
value_type
>
( 0 ) )
28
}
max_value_type
;
29
30
CUDA_HOSTDEV
Identifier_Gpu
() :
m_id
(
max_value
){};
31
CUDA_HOSTDEV
Identifier_Gpu
(
const
Identifier_Gpu
& value ) :
m_id
( value.
m_id
){};
32
CUDA_HOSTDEV
Identifier_Gpu
(
value_type
value ) :
m_id
( value ){};
33
34
CUDA_HOSTDEV
operator
value_type
()
const
{
return
m_id
; }
35
36
CUDA_HOSTDEV
Identifier_Gpu
&
operator=
(
const
Identifier_Gpu
& old ) {
37
m_id
= old;
38
return
( *
this
);
39
};
40
CUDA_HOSTDEV
Identifier_Gpu
&
operator=
(
value_type
value ) {
41
m_id
= value;
42
return
( *
this
);
43
};
44
CUDA_HOSTDEV
bool
operator==
(
const
Identifier_Gpu
& other )
const
{
return
(
m_id
== other.m_id ); }
45
CUDA_HOSTDEV
bool
operator!=
(
const
Identifier_Gpu
& other )
const
{
return
(
m_id
!= other.m_id ); }
46
CUDA_HOSTDEV
bool
operator<
(
const
Identifier_Gpu
& other )
const
{
return
(
m_id
< other.m_id ); }
47
CUDA_HOSTDEV
bool
operator>
(
const
Identifier_Gpu
& other )
const
{
return
(
m_id
> other.m_id ); }
48
CUDA_HOSTDEV
bool
operator<=
(
const
Identifier_Gpu
& other )
const
{
return
(
m_id
<= other.m_id ); }
49
CUDA_HOSTDEV
bool
operator>=
(
const
Identifier_Gpu
& other )
const
{
return
(
m_id
>= other.m_id ); }
50
CUDA_HOSTDEV
bool
operator==
(
Identifier_Gpu::value_type
other )
const
{
return
(
m_id
== other ); }
51
CUDA_HOSTDEV
bool
operator!=
(
Identifier_Gpu::value_type
other )
const
{
return
(
m_id
!= other ); }
52
53
protected
:
54
value_type
m_id
;
55
};
56
57
#endif
CUDA_HOSTDEV
#define CUDA_HOSTDEV
Definition
Identifier_g.h:12
Identifier_Gpu::value_type
long long value_type
Definition
Identifier_g.h:17
Identifier_Gpu::max_value_type
enum Identifier_Gpu::max_value_type_enum max_value_type
Identifier_Gpu::Identifier_Gpu
CUDA_HOSTDEV Identifier_Gpu(value_type value)
Definition
Identifier_g.h:32
Identifier_Gpu::operator==
CUDA_HOSTDEV bool operator==(Identifier_Gpu::value_type other) const
Definition
Identifier_g.h:50
Identifier_Gpu::Identifier_Gpu
CUDA_HOSTDEV Identifier_Gpu(const Identifier_Gpu &value)
Definition
Identifier_g.h:31
Identifier_Gpu::bit_defs
enum Identifier_Gpu::bit_defs_enum bit_defs
Identifier_Gpu::operator==
CUDA_HOSTDEV bool operator==(const Identifier_Gpu &other) const
Definition
Identifier_g.h:44
Identifier_Gpu::operator>
CUDA_HOSTDEV bool operator>(const Identifier_Gpu &other) const
Definition
Identifier_g.h:47
Identifier_Gpu::bit_defs_enum
bit_defs_enum
Definition
Identifier_g.h:19
Identifier_Gpu::MAX_BIT
@ MAX_BIT
Definition
Identifier_g.h:21
Identifier_Gpu::NBITS
@ NBITS
Definition
Identifier_g.h:20
Identifier_Gpu::ALL_BITS
@ ALL_BITS
Definition
Identifier_g.h:22
Identifier_Gpu::operator<
CUDA_HOSTDEV bool operator<(const Identifier_Gpu &other) const
Definition
Identifier_g.h:46
Identifier_Gpu::operator<=
CUDA_HOSTDEV bool operator<=(const Identifier_Gpu &other) const
Definition
Identifier_g.h:48
Identifier_Gpu::operator=
CUDA_HOSTDEV Identifier_Gpu & operator=(const Identifier_Gpu &old)
Definition
Identifier_g.h:36
Identifier_Gpu::operator!=
CUDA_HOSTDEV bool operator!=(Identifier_Gpu::value_type other) const
Definition
Identifier_g.h:51
Identifier_Gpu::max_value_type_enum
max_value_type_enum
Definition
Identifier_g.h:25
Identifier_Gpu::max_value
@ max_value
Definition
Identifier_g.h:27
Identifier_Gpu::operator!=
CUDA_HOSTDEV bool operator!=(const Identifier_Gpu &other) const
Definition
Identifier_g.h:45
Identifier_Gpu::Identifier_Gpu
CUDA_HOSTDEV Identifier_Gpu()
Definition
Identifier_g.h:30
Identifier_Gpu::m_id
value_type m_id
Definition
Identifier_g.h:54
Identifier_Gpu::operator>=
CUDA_HOSTDEV bool operator>=(const Identifier_Gpu &other) const
Definition
Identifier_g.h:49
Identifier_Gpu::operator=
CUDA_HOSTDEV Identifier_Gpu & operator=(value_type value)
Definition
Identifier_g.h:40
Generated on
for ATLAS Offline Software by
1.17.0