Skip to content

Commit

Permalink
[SYCL][NFC] Remove item dependency on reduction. (intel#12135)
Browse files Browse the repository at this point in the history
Use Builder::createItem help function to create `item` object instead of
adding one helper function in reduction namespace.
  • Loading branch information
bader authored Dec 11, 2023
1 parent 525e69f commit 8074617
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
5 changes: 3 additions & 2 deletions sycl/include/sycl/detail/reduction_forward.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

#pragma once

#include <sycl/detail/helpers.hpp> // for Builder
#include <sycl/detail/item_base.hpp> // for range
#include <sycl/id.hpp> // for id
#include <sycl/item.hpp> // for getDelinearizedItem, item
#include <sycl/item.hpp> // for item
#include <sycl/nd_range.hpp> // for nd_range
#include <sycl/range.hpp> // for range

Expand Down Expand Up @@ -51,7 +52,7 @@ template <class FunctorTy> void withAuxHandler(handler &CGH, FunctorTy Func);

template <int Dims>
item<Dims, false> getDelinearizedItem(range<Dims> Range, id<Dims> Id) {
return {Range, Id};
return Builder::createItem<Dims, false>(Range, Id);
}
} // namespace reduction

Expand Down
10 changes: 1 addition & 9 deletions sycl/include/sycl/item.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,13 @@

namespace sycl {
inline namespace _V1 {

namespace detail {
class Builder;
template <typename TransformedArgType, int Dims, typename KernelType>
class RoundedRangeKernel;
template <typename TransformedArgType, int Dims, typename KernelType>
class RoundedRangeKernelWithKH;

namespace reduction {
template <int Dims>
item<Dims, false> getDelinearizedItem(range<Dims> Range, id<Dims> Id);
} // namespace reduction
} // namespace detail

/// Identifies an instance of the function object executing at each point
Expand Down Expand Up @@ -133,10 +129,6 @@ template <int Dimensions = 1, bool with_offset = true> class item {
friend class detail::Builder;

private:
template <int Dims>
friend item<Dims, false>
detail::reduction::getDelinearizedItem(range<Dims> Range, id<Dims> Id);

detail::ItemBase<Dimensions, with_offset> MImpl;
};

Expand Down

0 comments on commit 8074617

Please sign in to comment.