Skip to content

[SYCL][NFC] Remove item dependency on reduction. #12135

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 2 commits into from
Dec 11, 2023
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
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