From e26cc42ad2957ee78ad0bd6baefacc482c788283 Mon Sep 17 00:00:00 2001 From: Klochkov Date: Tue, 16 Jul 2019 20:13:34 -0700 Subject: [PATCH] [SYCL][NFC] Fix Windows warnings, sync usage of class/struct with new SYCL SPEC Signed-off-by: Klochkov --- sycl/include/CL/sycl/detail/array.hpp | 2 +- sycl/include/CL/sycl/detail/helpers.hpp | 7 ++++--- sycl/include/CL/sycl/group.hpp | 4 ++-- sycl/include/CL/sycl/id.hpp | 2 +- sycl/include/CL/sycl/intel/sub_group.hpp | 2 +- sycl/include/CL/sycl/intel/sub_group_host.hpp | 2 +- sycl/include/CL/sycl/item.hpp | 16 ++++++++-------- sycl/include/CL/sycl/nd_item.hpp | 8 ++++---- sycl/include/CL/sycl/range.hpp | 2 +- 9 files changed, 23 insertions(+), 22 deletions(-) diff --git a/sycl/include/CL/sycl/detail/array.hpp b/sycl/include/CL/sycl/detail/array.hpp index 7dfe3268825da..93cfefa60238f 100644 --- a/sycl/include/CL/sycl/detail/array.hpp +++ b/sycl/include/CL/sycl/detail/array.hpp @@ -14,7 +14,7 @@ namespace cl { namespace sycl { -template struct id; +template class id; template class range; namespace detail { diff --git a/sycl/include/CL/sycl/detail/helpers.hpp b/sycl/include/CL/sycl/detail/helpers.hpp index 78b6ce9e9bbcf..0957677576d39 100644 --- a/sycl/include/CL/sycl/detail/helpers.hpp +++ b/sycl/include/CL/sycl/detail/helpers.hpp @@ -22,10 +22,10 @@ namespace cl { namespace sycl { class context; class event; -template struct item; +template class item; template class group; template class range; -template struct id; +template class id; template class nd_item; enum class memory_order; template class h_item; @@ -40,7 +40,8 @@ getOrWaitEvents(std::vector DepEvents, void waitEvents(std::vector DepEvents); -struct Builder { +class Builder { +public: Builder() = delete; template static group createGroup(const cl::sycl::range &G, diff --git a/sycl/include/CL/sycl/group.hpp b/sycl/include/CL/sycl/group.hpp index 4bd08292d94ac..fd7d8b396bd68 100644 --- a/sycl/include/CL/sycl/group.hpp +++ b/sycl/include/CL/sycl/group.hpp @@ -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() { @@ -290,7 +290,7 @@ template class group { } protected: - friend struct detail::Builder; + friend class detail::Builder; group(const range &G, const range &L, const id &I) : globalRange(G), localRange(L), index(I) {} diff --git a/sycl/include/CL/sycl/id.hpp b/sycl/include/CL/sycl/id.hpp index 299eb2c3f6585..5f0b65809dc87 100644 --- a/sycl/include/CL/sycl/id.hpp +++ b/sycl/include/CL/sycl/id.hpp @@ -16,7 +16,7 @@ namespace cl { namespace sycl { template class range; template class item; -template struct id : public detail::array { +template class id : public detail::array { private: using base = detail::array; static_assert(dimensions >= 1 && dimensions <= 3, diff --git a/sycl/include/CL/sycl/intel/sub_group.hpp b/sycl/include/CL/sycl/intel/sub_group.hpp index 02195d4aad250..21ac2dc11f6e1 100644 --- a/sycl/include/CL/sycl/intel/sub_group.hpp +++ b/sycl/include/CL/sycl/intel/sub_group.hpp @@ -343,7 +343,7 @@ struct sub_group { } protected: - template friend struct cl::sycl::nd_item; + template friend class cl::sycl::nd_item; sub_group() = default; }; } // namespace intel diff --git a/sycl/include/CL/sycl/intel/sub_group_host.hpp b/sycl/include/CL/sycl/intel/sub_group_host.hpp index f2a7ced951817..9084164f77965 100644 --- a/sycl/include/CL/sycl/intel/sub_group_host.hpp +++ b/sycl/include/CL/sycl/intel/sub_group_host.hpp @@ -137,7 +137,7 @@ struct sub_group { } protected: - template friend struct cl::sycl::nd_item; + template friend class cl::sycl::nd_item; sub_group() { throw runtime_error("Subgroups are not supported on host device. "); } diff --git a/sycl/include/CL/sycl/item.hpp b/sycl/include/CL/sycl/item.hpp index d9b60258471b8..5dad5eb53378c 100644 --- a/sycl/include/CL/sycl/item.hpp +++ b/sycl/include/CL/sycl/item.hpp @@ -16,14 +16,14 @@ namespace cl { namespace sycl { namespace detail { -struct Builder; +class Builder; } -template struct id; +template class id; template class range; template class h_item; -template struct item { - +template class item { +public: item() = delete; id get_id() const { return index; } @@ -86,10 +86,10 @@ template struct item { protected: // For call constructor inside conversion operator - friend struct item; - friend struct item; - friend struct h_item; - friend struct detail::Builder; + friend class item; + friend class item; + friend class h_item; + friend class detail::Builder; template item(typename std::enable_if<(W == true), const range>::type &R, diff --git a/sycl/include/CL/sycl/nd_item.hpp b/sycl/include/CL/sycl/nd_item.hpp index c3e4348e9796d..fbd6cca18680a 100644 --- a/sycl/include/CL/sycl/nd_item.hpp +++ b/sycl/include/CL/sycl/nd_item.hpp @@ -24,10 +24,10 @@ namespace cl { namespace sycl { namespace detail { -struct Builder; +class Builder; } -template struct nd_item { - +template class nd_item { +public: nd_item() = delete; id get_global_id() const { return globalItem.get_id(); } @@ -154,7 +154,7 @@ template struct nd_item { } protected: - friend struct detail::Builder; + friend class detail::Builder; nd_item(const item &GL, const item &L, const group &GR) : globalItem(GL), localItem(L), Group(GR) {} diff --git a/sycl/include/CL/sycl/range.hpp b/sycl/include/CL/sycl/range.hpp index 1fc3bb81f8fe2..501e97a6fe8a8 100644 --- a/sycl/include/CL/sycl/range.hpp +++ b/sycl/include/CL/sycl/range.hpp @@ -13,7 +13,7 @@ namespace cl { namespace sycl { -template struct id; +template class id; template class range : public detail::array { static_assert(dimensions >= 1 && dimensions <= 3,