Skip to content

[SYCL][NFC] Fix Windows warnings, sync usage of class/struct with new… #332

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sycl/include/CL/sycl/detail/array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace cl {
namespace sycl {
template <int dimensions> struct id;
template <int dimensions> class id;
template <int dimensions> class range;
namespace detail {

Expand Down
7 changes: 4 additions & 3 deletions sycl/include/CL/sycl/detail/helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ namespace cl {
namespace sycl {
class context;
class event;
template <int dimensions, bool with_offset> struct item;
template <int dimensions, bool with_offset> class item;
template <int dimensions> class group;
template <int dimensions> class range;
template <int dimensions> struct id;
template <int dimensions> class id;
template <int dimensions> class nd_item;
enum class memory_order;
template <int dimensions> class h_item;
Expand All @@ -40,7 +40,8 @@ getOrWaitEvents(std::vector<cl::sycl::event> DepEvents,

void waitEvents(std::vector<cl::sycl::event> DepEvents);

struct Builder {
class Builder {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builder struct is not part of the SYCL specification.
Did you decide to avoid using struct for all types in our project - even for internal?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is already 3rd time when I fix something for Builder. Have no idea why, but Builder tends to be treated as class by other developers.

public:
Builder() = delete;
template <int dimensions>
static group<dimensions> createGroup(const cl::sycl::range<dimensions> &G,
Expand Down
4 changes: 2 additions & 2 deletions sycl/include/CL/sycl/group.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
namespace cl {
namespace sycl {
namespace detail {
struct Builder;
class Builder;

// Implements a barrier accross work items within a work group.
static inline void workGroupBarrier() {
Expand Down Expand Up @@ -290,7 +290,7 @@ template <int dimensions = 1> class group {
}

protected:
friend struct detail::Builder;
friend class detail::Builder;
group(const range<dimensions> &G, const range<dimensions> &L,
const id<dimensions> &I)
: globalRange(G), localRange(L), index(I) {}
Expand Down
2 changes: 1 addition & 1 deletion sycl/include/CL/sycl/id.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace cl {
namespace sycl {
template <int dimensions> class range;
template <int dimensions, bool with_offset> class item;
template <int dimensions = 1> struct id : public detail::array<dimensions> {
template <int dimensions = 1> class id : public detail::array<dimensions> {
private:
using base = detail::array<dimensions>;
static_assert(dimensions >= 1 && dimensions <= 3,
Expand Down
2 changes: 1 addition & 1 deletion sycl/include/CL/sycl/intel/sub_group.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ struct sub_group {
}

protected:
template <int dimensions> friend struct cl::sycl::nd_item;
template <int dimensions> friend class cl::sycl::nd_item;
sub_group() = default;
};
} // namespace intel
Expand Down
2 changes: 1 addition & 1 deletion sycl/include/CL/sycl/intel/sub_group_host.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ struct sub_group {
}

protected:
template <int dimensions> friend struct cl::sycl::nd_item;
template <int dimensions> friend class cl::sycl::nd_item;
sub_group() {
throw runtime_error("Subgroups are not supported on host device. ");
}
Expand Down
16 changes: 8 additions & 8 deletions sycl/include/CL/sycl/item.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
namespace cl {
namespace sycl {
namespace detail {
struct Builder;
class Builder;
}
template <int dimensions> struct id;
template <int dimensions> class id;
template <int dimensions> class range;
template <int dimensions> class h_item;

template <int dimensions = 1, bool with_offset = true> struct item {

template <int dimensions = 1, bool with_offset = true> class item {
public:
item() = delete;

id<dimensions> get_id() const { return index; }
Expand Down Expand Up @@ -86,10 +86,10 @@ template <int dimensions = 1, bool with_offset = true> struct item {

protected:
// For call constructor inside conversion operator
friend struct item<dimensions, false>;
friend struct item<dimensions, true>;
friend struct h_item<dimensions>;
friend struct detail::Builder;
friend class item<dimensions, false>;
friend class item<dimensions, true>;
friend class h_item<dimensions>;
friend class detail::Builder;

template <size_t W = with_offset>
item(typename std::enable_if<(W == true), const range<dimensions>>::type &R,
Expand Down
8 changes: 4 additions & 4 deletions sycl/include/CL/sycl/nd_item.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
namespace cl {
namespace sycl {
namespace detail {
struct Builder;
class Builder;
}
template <int dimensions = 1> struct nd_item {

template <int dimensions = 1> class nd_item {
public:
nd_item() = delete;

id<dimensions> get_global_id() const { return globalItem.get_id(); }
Expand Down Expand Up @@ -154,7 +154,7 @@ template <int dimensions = 1> struct nd_item {
}

protected:
friend struct detail::Builder;
friend class detail::Builder;
nd_item(const item<dimensions, true> &GL, const item<dimensions, false> &L,
const group<dimensions> &GR)
: globalItem(GL), localItem(L), Group(GR) {}
Expand Down
2 changes: 1 addition & 1 deletion sycl/include/CL/sycl/range.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace cl {
namespace sycl {
template <int dimensions> struct id;
template <int dimensions> class id;
template <int dimensions = 1>
class range : public detail::array<dimensions> {
static_assert(dimensions >= 1 && dimensions <= 3,
Expand Down