-
Notifications
You must be signed in to change notification settings - Fork 795
[SYCL] Introduce nd_range_view and integrate with handler-less path #20531
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
Draft
slawekptak
wants to merge
28
commits into
intel:sycl
Choose a base branch
from
slawekptak:nd_range_view_struct_and_no_handler
base: sycl
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+271
−94
Draft
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
9571fec
[SYCL] Add structure to pass references to ranges
Alexandr-Konovalov 2521805
Fix formatting.
Alexandr-Konovalov 1a90e48
Fix const.
Alexandr-Konovalov 38945f3
Rename RangesRefT to ranges_ref_view and move to sycl::detail namespace.
Alexandr-Konovalov d4c267e
Fix formatting.
Alexandr-Konovalov 0d76be9
Move assignment near ctors.
Alexandr-Konovalov 858bf21
Decrease dumpilcation is the test.
Alexandr-Konovalov 95beb6a
Fix formatting.
Alexandr-Konovalov f2e347d
Fix formatting.
Alexandr-Konovalov 71e2eee
Add export to sycl::detail::NDRDescT.
Alexandr-Konovalov 7a3f269
Fix formatting.
Alexandr-Konovalov e6ab5e7
Merge branch 'sycl' into Alexandr-Konovalov/ref-ndrange
Alexandr-Konovalov d309440
Rename sycl::detail::ranges_ref_view to nd_range_view.
Alexandr-Konovalov c7bc868
Fix formatting.
Alexandr-Konovalov 2754978
Merge branch 'sycl' into Alexandr-Konovalov/ref-ndrange
Alexandr-Konovalov d635399
Merge branch 'sycl' into Alexandr-Konovalov/ref-ndrange
Alexandr-Konovalov 063997e
Merge branch 'sycl' into nd_range_view_struct_only
slawekptak a3ae6c0
Update the nd_range_view and NDRDescT conversion
slawekptak fbebaef
Merge branch 'sycl' into nd_range_view_struct_and_no_handler
slawekptak ce2a223
Merge branch 'sycl' into nd_range_view_struct_and_no_handler
slawekptak 8c970ab
Update Linux symbols
slawekptak 8a434a1
Update the include deps tests
slawekptak fa35c99
Add nd_range_view layout tests
slawekptak b4184b4
Move the nd_range_view layout test to a separate file
slawekptak 1677e6d
Merge branch 'sycl' into nd_range_view_struct_and_no_handler
slawekptak fa083a4
Update Linux symbols
slawekptak 8227e9a
Update Windows symbols
slawekptak df435a0
Fix formatting
slawekptak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| //==---- nd_range_view.hpp --- SYCL iteration with reference to ranges ---==// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <sycl/nd_range.hpp> | ||
|
|
||
| namespace sycl { | ||
| inline namespace _V1 { | ||
| namespace detail { | ||
|
|
||
| class NDRDescT; | ||
|
|
||
| // The structure to keep dimension and references to ranges unified for | ||
| // all dimensions. | ||
| class nd_range_view { | ||
|
|
||
| public: | ||
| nd_range_view() = default; | ||
| nd_range_view(const nd_range_view &Desc) = default; | ||
| nd_range_view(nd_range_view &&Desc) = default; | ||
| nd_range_view &operator=(const nd_range_view &Desc) = default; | ||
| nd_range_view &operator=(nd_range_view &&Desc) = default; | ||
|
|
||
| template <int Dims_> | ||
| nd_range_view(sycl::range<Dims_> &N, bool SetNumWorkGroups = false) | ||
| : MGlobalSize(&(N[0])), MSetNumWorkGroups(SetNumWorkGroups), | ||
| MDims{size_t(Dims_)} {} | ||
|
|
||
| template <int Dims_> | ||
| nd_range_view(sycl::range<Dims_> &GlobalSize, sycl::id<Dims_> &Offset) | ||
| : MGlobalSize(&(GlobalSize[0])), MOffset(&(Offset[0])), | ||
| MDims{size_t(Dims_)} {} | ||
|
|
||
| template <int Dims_> | ||
| nd_range_view(sycl::nd_range<Dims_> &ExecutionRange) | ||
| : MGlobalSize(&(ExecutionRange.globalSize[0])), | ||
| MLocalSize(&(ExecutionRange.localSize[0])), | ||
| MOffset(&(ExecutionRange.offset[0])), MDims{size_t(Dims_)} {} | ||
|
|
||
| sycl::detail::NDRDescT toNDRDescT() const; | ||
|
|
||
| const size_t *MGlobalSize = nullptr; | ||
| const size_t *MLocalSize = nullptr; | ||
| const size_t *MOffset = nullptr; | ||
| bool MSetNumWorkGroups = false; | ||
| size_t MDims = 0; | ||
| }; | ||
|
|
||
| } // namespace detail | ||
| } // namespace _V1 | ||
| } // namespace sycl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| // RUN: %clangxx -fsycl -c -fno-color-diagnostics -Xclang -fdump-record-layouts %s -o %t.out | FileCheck %s | ||
| // RUN: %clangxx -fsycl -fsycl-device-only -c -fno-color-diagnostics -Xclang -fdump-record-layouts %s -o %t.out | FileCheck %s | ||
| // REQUIRES: linux | ||
| // UNSUPPORTED: libcxx | ||
|
|
||
| // clang-format off | ||
|
|
||
| #include <sycl/detail/nd_range_view.hpp> | ||
|
|
||
|
|
||
| SYCL_EXTERNAL void nd_range_view(sycl::detail::nd_range_view) {} | ||
| // CHECK: 0 | class sycl::detail::nd_range_view | ||
| // CHECK-NEXT: 0 | const size_t * MGlobalSize | ||
| // CHECK-NEXT: 8 | const size_t * MLocalSize | ||
| // CHECK-NEXT: 16 | const size_t * MOffset | ||
| // CHECK-NEXT: 24 | _Bool MSetNumWorkGroups | ||
| // CHECK-NEXT: 32 | size_t MDims | ||
| // CHECK-NEXT: | [sizeof=40, dsize=40, align=8, | ||
| // CHECK-NEXT: | nvsize=40, nvalign=8] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove the comment because it is useless. The
nd_range_view.hppname is self-descriptive.