Skip to content

Commit

Permalink
The constexpr qualifier on the default constructor SharedAllocationRe…
Browse files Browse the repository at this point in the history
…cord

confused the Intel/16 optimizer, leading to incorrect initialization.
Removed the qualifier to fix issu3 #186.
  • Loading branch information
hcedwar committed Mar 15, 2016
1 parent c9db82a commit 37f235d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/impl/KokkosExp_SharedAlloc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class SharedAllocationRecord< void , void > {

~SharedAllocationRecord() = default ;

constexpr SharedAllocationRecord()
SharedAllocationRecord()
: m_alloc_ptr( 0 )
, m_alloc_size( 0 )
, m_dealloc( 0 )
Expand All @@ -144,7 +144,7 @@ class SharedAllocationRecord< void , void > {
void * data() const { return reinterpret_cast<void*>( m_alloc_ptr + 1 ); }

/* User's memory begins at the end of the header */
constexpr size_t size() const { return m_alloc_size - sizeof(SharedAllocationHeader) ; }
size_t size() const { return m_alloc_size - sizeof(SharedAllocationHeader) ; }

/* Cannot be 'constexpr' because 'm_count' is volatile */
int use_count() const { return *static_cast<const volatile int *>(&m_count); }
Expand Down

0 comments on commit 37f235d

Please sign in to comment.