ATLAS Offline Software
Loading...
Searching...
No Matches
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
16public:
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 ) )
24
25 typedef enum max_value_type_enum {
26 // max_value = 0xFFFFFFFFFFFFFFFFULL
27 max_value = ~( static_cast<value_type>( 0 ) )
29
31 CUDA_HOSTDEV Identifier_Gpu( const Identifier_Gpu& value ) : m_id( value.m_id ){};
33
34 CUDA_HOSTDEV operator value_type() const { return m_id; }
35
37 m_id = old;
38 return ( *this );
39 };
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
53protected:
55};
56
57#endif
#define CUDA_HOSTDEV
long long value_type
enum Identifier_Gpu::max_value_type_enum max_value_type
CUDA_HOSTDEV Identifier_Gpu(value_type value)
CUDA_HOSTDEV bool operator==(Identifier_Gpu::value_type other) const
CUDA_HOSTDEV Identifier_Gpu(const Identifier_Gpu &value)
enum Identifier_Gpu::bit_defs_enum bit_defs
CUDA_HOSTDEV bool operator==(const Identifier_Gpu &other) const
CUDA_HOSTDEV bool operator>(const Identifier_Gpu &other) const
CUDA_HOSTDEV bool operator<(const Identifier_Gpu &other) const
CUDA_HOSTDEV bool operator<=(const Identifier_Gpu &other) const
CUDA_HOSTDEV Identifier_Gpu & operator=(const Identifier_Gpu &old)
CUDA_HOSTDEV bool operator!=(Identifier_Gpu::value_type other) const
CUDA_HOSTDEV bool operator!=(const Identifier_Gpu &other) const
CUDA_HOSTDEV Identifier_Gpu()
value_type m_id
CUDA_HOSTDEV bool operator>=(const Identifier_Gpu &other) const
CUDA_HOSTDEV Identifier_Gpu & operator=(value_type value)