Skip to content

Commit 7b76899

Browse files
[SYCL][NFC] Fix confused clang-format formatting in accessor.hpp (#5273)
Signed-off-by: Steffen Larsen <[email protected]>
1 parent fe2e35e commit 7b76899

File tree

1 file changed

+50
-50
lines changed

1 file changed

+50
-50
lines changed

sycl/include/CL/sycl/accessor.hpp

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,64 +1688,64 @@ class __SYCL_SPECIAL_CLASS accessor :
16881688

16891689
template <int Dims = Dimensions>
16901690
operator typename detail::enable_if_t<Dims == 0 &&
1691-
#ifdef __ENABLE_USM_ADDR_SPACE__
16921691
AccessMode == access::mode::atomic,
1693-
atomic<DataT>>() const {
1692+
#ifdef __ENABLE_USM_ADDR_SPACE__
1693+
atomic<DataT>
16941694
#else
1695-
AccessMode == access::mode::atomic,
1696-
atomic<DataT, AS>>() const {
1695+
atomic<DataT, AS>
16971696
#endif
1698-
const size_t LinearIndex = getLinearIndex(id<AdjustedDim>());
1699-
return atomic<DataT, AS>(
1700-
multi_ptr<DataT, AS>(getQualifiedPtr() + LinearIndex));
1701-
}
1697+
>() const {
1698+
const size_t LinearIndex = getLinearIndex(id<AdjustedDim>());
1699+
return atomic<DataT, AS>(
1700+
multi_ptr<DataT, AS>(getQualifiedPtr() + LinearIndex));
1701+
}
17021702

1703-
template <int Dims = Dimensions>
1704-
typename detail::enable_if_t<(Dims > 0) && AccessMode == access::mode::atomic,
1705-
atomic<DataT, AS>>
1706-
operator[](id<Dimensions> Index) const {
1707-
const size_t LinearIndex = getLinearIndex(Index);
1708-
return atomic<DataT, AS>(
1709-
multi_ptr<DataT, AS>(getQualifiedPtr() + LinearIndex));
1710-
}
1703+
template <int Dims = Dimensions>
1704+
typename detail::enable_if_t<(Dims > 0) && AccessMode == access::mode::atomic,
1705+
atomic<DataT, AS>>
1706+
operator[](id<Dimensions> Index) const {
1707+
const size_t LinearIndex = getLinearIndex(Index);
1708+
return atomic<DataT, AS>(
1709+
multi_ptr<DataT, AS>(getQualifiedPtr() + LinearIndex));
1710+
}
17111711

1712-
template <int Dims = Dimensions>
1713-
typename detail::enable_if_t<Dims == 1 && AccessMode == access::mode::atomic,
1714-
atomic<DataT, AS>>
1715-
operator[](size_t Index) const {
1716-
const size_t LinearIndex = getLinearIndex(id<AdjustedDim>(Index));
1717-
return atomic<DataT, AS>(
1718-
multi_ptr<DataT, AS>(getQualifiedPtr() + LinearIndex));
1719-
}
1720-
template <int Dims = Dimensions, typename = detail::enable_if_t<(Dims > 1)>>
1721-
typename AccessorCommonT::template AccessorSubscript<Dims - 1>
1722-
operator[](size_t Index) const {
1723-
return AccessorSubscript<Dims - 1>(*this, Index);
1724-
}
1712+
template <int Dims = Dimensions>
1713+
typename detail::enable_if_t<Dims == 1 && AccessMode == access::mode::atomic,
1714+
atomic<DataT, AS>>
1715+
operator[](size_t Index) const {
1716+
const size_t LinearIndex = getLinearIndex(id<AdjustedDim>(Index));
1717+
return atomic<DataT, AS>(
1718+
multi_ptr<DataT, AS>(getQualifiedPtr() + LinearIndex));
1719+
}
1720+
template <int Dims = Dimensions, typename = detail::enable_if_t<(Dims > 1)>>
1721+
typename AccessorCommonT::template AccessorSubscript<Dims - 1>
1722+
operator[](size_t Index) const {
1723+
return AccessorSubscript<Dims - 1>(*this, Index);
1724+
}
17251725

1726-
template <access::target AccessTarget_ = AccessTarget,
1727-
typename =
1728-
detail::enable_if_t<AccessTarget_ == access::target::host_buffer>>
1729-
DataT *get_pointer() const {
1730-
return getPointerAdjusted();
1731-
}
1726+
template <access::target AccessTarget_ = AccessTarget,
1727+
typename = detail::enable_if_t<AccessTarget_ ==
1728+
access::target::host_buffer>>
1729+
DataT *get_pointer() const {
1730+
return getPointerAdjusted();
1731+
}
17321732

1733-
template <
1734-
access::target AccessTarget_ = AccessTarget,
1735-
typename = detail::enable_if_t<AccessTarget_ == access::target::device>>
1736-
global_ptr<DataT> get_pointer() const {
1737-
return global_ptr<DataT>(getPointerAdjusted());
1738-
}
1733+
template <
1734+
access::target AccessTarget_ = AccessTarget,
1735+
typename = detail::enable_if_t<AccessTarget_ == access::target::device>>
1736+
global_ptr<DataT> get_pointer() const {
1737+
return global_ptr<DataT>(getPointerAdjusted());
1738+
}
17391739

1740-
template <access::target AccessTarget_ = AccessTarget,
1741-
typename = detail::enable_if_t<AccessTarget_ ==
1742-
access::target::constant_buffer>>
1743-
constant_ptr<DataT> get_pointer() const {
1744-
return constant_ptr<DataT>(getPointerAdjusted());
1745-
}
1740+
template <access::target AccessTarget_ = AccessTarget,
1741+
typename = detail::enable_if_t<AccessTarget_ ==
1742+
access::target::constant_buffer>>
1743+
constant_ptr<DataT> get_pointer() const {
1744+
return constant_ptr<DataT>(getPointerAdjusted());
1745+
}
17461746

1747-
bool operator==(const accessor &Rhs) const { return impl == Rhs.impl; }
1748-
bool operator!=(const accessor &Rhs) const { return !(*this == Rhs); }
1747+
bool operator==(const accessor &Rhs) const { return impl == Rhs.impl; }
1748+
bool operator!=(const accessor &Rhs) const { return !(*this == Rhs); }
17491749

17501750
private:
17511751
// supporting function for get_pointer()
@@ -1768,7 +1768,7 @@ bool operator!=(const accessor &Rhs) const { return !(*this == Rhs); }
17681768
"buffer size must be greater than zero.",
17691769
PI_INVALID_VALUE);
17701770
}
1771-
}; // namespace sycl
1771+
};
17721772

17731773
#if __cplusplus > 201402L
17741774

0 commit comments

Comments
 (0)