Skip to content

Commit

Permalink
fix gpu errors (#306)
Browse files Browse the repository at this point in the history
* Explicitly define constructors instead of using the compiler generated ones (works around compiler bugs)
  • Loading branch information
dtaller authored Dec 4, 2024
1 parent 25fd008 commit daa9b83
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions src/care/host_device_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ namespace care {
class host_device_map< key_type, mapped_type, RAJA::seq_exec> {
public:
// default constructor
host_device_map() noexcept = default;
host_device_map() noexcept {};

// constructor taking max number of entries
host_device_map(size_t max_entries) : host_device_map{} {
Expand All @@ -86,7 +86,15 @@ namespace care {
}

// copy constructor
host_device_map(host_device_map const & other) noexcept = default;
host_device_map(host_device_map const & other) noexcept :
m_map(other.m_map),
m_size(other.m_size),
m_iterator(other.m_iterator),
m_next_iterator_index(other.m_next_iterator_index),
m_max_size(other.m_max_size),
m_signal(other.m_signal)
{
}

// move constructor
host_device_map(host_device_map && other) noexcept {
Expand Down Expand Up @@ -387,7 +395,7 @@ namespace care {
{
public:
// default constructor
host_device_map() noexcept = default;
host_device_map() noexcept {};

// constructor
host_device_map(size_t max_entries) : host_device_map{} {
Expand All @@ -406,9 +414,16 @@ namespace care {
}

// copy constructor
host_device_map(host_device_map const & other) noexcept = default;
host_device_map(host_device_map const & other) noexcept :
m_size_ptr(other.m_size_ptr),
m_size(other.m_size),
m_map(other.m_map),
m_max_size(other.m_max_size),
m_signal(other.m_signal)
{
}

// move constructor
// move constructor
host_device_map(host_device_map && other) noexcept {
delete m_size_ptr;
m_size_ptr = other.m_size_ptr;
Expand Down

0 comments on commit daa9b83

Please sign in to comment.