Skip to content

Commit

Permalink
[SYCL][NFC] Fix special member functions for GCC 11.2 and C++20 (#5068)
Browse files Browse the repository at this point in the history
I got an issue while compiling the SYCL runtime on Ubuntu 21.10 G++ 11.2 and C++20.
Please add more modern configurations to your GitHub Actions to test at least with the latest compilers and latest languages.
While SYCL 2020 requires at least a C++17 compiler, it should not break with C++20 or C++2b.
  • Loading branch information
keryell authored Dec 3, 2021
1 parent 842f2dd commit d155897
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions sycl/include/CL/sycl/nd_item.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,22 +163,20 @@ template <int dimensions = 1> class nd_item {
Group.wait_for(events...);
}

nd_item<dimensions>(const nd_item<dimensions> &rhs) = default;
nd_item(const nd_item &rhs) = default;

nd_item<dimensions>(nd_item<dimensions> &&rhs) = default;
nd_item(nd_item &&rhs) = default;

nd_item<dimensions> &operator=(const nd_item<dimensions> &rhs) = default;
nd_item &operator=(const nd_item &rhs) = default;

nd_item<dimensions> &operator=(nd_item<dimensions> &&rhs) = default;
nd_item &operator=(nd_item &&rhs) = default;

bool operator==(const nd_item<dimensions> &rhs) const {
bool operator==(const nd_item &rhs) const {
return (rhs.localItem == this->localItem) &&
(rhs.globalItem == this->globalItem) && (rhs.Group == this->Group);
}

bool operator!=(const nd_item<dimensions> &rhs) const {
return !((*this) == rhs);
}
bool operator!=(const nd_item &rhs) const { return !((*this) == rhs); }

protected:
friend class detail::Builder;
Expand Down

0 comments on commit d155897

Please sign in to comment.