-
Notifications
You must be signed in to change notification settings - Fork 96
Compatibility to SYCL 2020 #943
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
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
80336b6
restore SYCL 2020 compatibility
upsj 7450d6a
use macro for subgroup size selection
upsj 56e8522
replace deprecated APIs
upsj 0c142c5
review updates
upsj bef0fba
remove unused code
upsj 9db55b6
fix deprecation warnings
upsj 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
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 |
---|---|---|
|
@@ -62,10 +62,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
InferredArgs... args) \ | ||
{ \ | ||
queue->submit([&](sycl::handler& cgh) { \ | ||
cgh.parallel_for(sycl_nd_range(grid, block), \ | ||
[=](sycl::nd_item<3> item_ct1) { \ | ||
kernel_(args..., item_ct1); \ | ||
}); \ | ||
cgh.parallel_for( \ | ||
sycl_nd_range(grid, block), [= \ | ||
](sycl::nd_item<3> item_ct1) [[sycl::reqd_sub_group_size( \ | ||
config::warp_size)]] { \ | ||
kernel_(args..., item_ct1); \ | ||
}); \ | ||
}); \ | ||
} | ||
|
||
|
@@ -78,17 +80,27 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
* @param name_ the name of the host function with config | ||
* @param kernel_ the kernel name | ||
*/ | ||
#define GKO_ENABLE_DEFAULT_HOST_CONFIG(name_, kernel_) \ | ||
template <std::uint32_t encoded, typename... InferredArgs> \ | ||
inline void name_(dim3 grid, dim3 block, gko::size_type, \ | ||
sycl::queue* queue, InferredArgs... args) \ | ||
{ \ | ||
queue->submit([&](sycl::handler& cgh) { \ | ||
cgh.parallel_for(sycl_nd_range(grid, block), \ | ||
[=](sycl::nd_item<3> item_ct1) { \ | ||
kernel_<encoded>(args..., item_ct1); \ | ||
}); \ | ||
}); \ | ||
#define GKO_ENABLE_DEFAULT_HOST_CONFIG(name_, kernel_) \ | ||
template <std::uint32_t encoded, typename... InferredArgs> \ | ||
inline void name_(dim3 grid, dim3 block, gko::size_type, \ | ||
sycl::queue* queue, InferredArgs... args) \ | ||
{ \ | ||
queue->submit([&](sycl::handler& cgh) { \ | ||
if constexpr (KCFG_1D::decode<1>(encoded) > 1) { \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. c++17 thanks to dpcpp |
||
cgh.parallel_for( \ | ||
sycl_nd_range(grid, block), [= \ | ||
](sycl::nd_item<3> item_ct1) [[sycl::reqd_sub_group_size( \ | ||
KCFG_1D::decode<1>( \ | ||
encoded))]] { \ | ||
kernel_<encoded>(args..., item_ct1); \ | ||
}); \ | ||
} else { \ | ||
cgh.parallel_for(sycl_nd_range(grid, block), \ | ||
[=](sycl::nd_item<3> item_ct1) { \ | ||
kernel_<encoded>(args..., item_ct1); \ | ||
}); \ | ||
} \ | ||
}); \ | ||
} | ||
|
||
/** | ||
|
@@ -119,9 +131,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
} | ||
|
||
// __WG_BOUND__ gives the cuda-like launch bound in cuda ordering | ||
#define __WG_BOUND_1D__(x) [[intel::reqd_work_group_size(1, 1, x)]] | ||
#define __WG_BOUND_2D__(x, y) [[intel::reqd_work_group_size(1, y, x)]] | ||
#define __WG_BOUND_3D__(x, y, z) [[intel::reqd_work_group_size(z, y, x)]] | ||
#define __WG_BOUND_1D__(x) [[sycl::reqd_work_group_size(1, 1, x)]] | ||
#define __WG_BOUND_2D__(x, y) [[sycl::reqd_work_group_size(1, y, x)]] | ||
tcojean marked this conversation as resolved.
Show resolved
Hide resolved
|
||
#define __WG_BOUND_3D__(x, y, z) [[sycl::reqd_work_group_size(z, y, x)]] | ||
#define WG_BOUND_OVERLOAD(_1, _2, _3, NAME, ...) NAME | ||
#define __WG_BOUND__(...) \ | ||
WG_BOUND_OVERLOAD(__VA_ARGS__, __WG_BOUND_3D__, __WG_BOUND_2D__, \ | ||
|
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
D556
div>
View file
Open in desktop
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
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.
should we leave as the default one not config::warp_size?
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.
I would leave it as warp_size, since that's als what we are using inside a few of these kernels (mostly SpMV)