Skip to content

Commit

Permalink
[SYCL] Deprecate parallel_for and single_task overloads with properties
Browse files Browse the repository at this point in the history
Signed-off-by: Hu, Peisen <[email protected]>
  • Loading branch information
HPS-1 committed Jan 21, 2025
1 parent 38e6e1b commit 153c9f1
Show file tree
Hide file tree
Showing 15 changed files with 485 additions and 85 deletions.
2 changes: 2 additions & 0 deletions devops/cts_exclude_filter_compfails
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# Please use "#" to add comments here.
# Do not delete the file even if it's empty.
# See https://github.com/intel/llvm/pull/16615
handler
2 changes: 1 addition & 1 deletion devops/dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"igc": {
"github_tag": "v2.5.6",
"version": "2.5.6",
"version": "v2.5.6",
"url": "https://github.com/intel/intel-graphics-compiler/releases/tag/v2.5.6",
"root": "{DEPS_ROOT}/opencl/runtime/linux/oclgpu"
},
Expand Down
2 changes: 1 addition & 1 deletion llvm/docs/requirements-hashed.txt
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ imagesize==1.4.1 \
--hash=sha256:0d8d18d08f840c19d0ee7ca1fd82490fdc3729b7ac93f49870406ddde8ef8d8b \
--hash=sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a
# via sphinx
jinja2==3.1.4 \
jinja2==3.1.5 \
--hash=sha256:4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369 \
--hash=sha256:bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d
# via
Expand Down
15 changes: 8 additions & 7 deletions sycl/cmake/modules/UnifiedRuntimeTag.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# commit 8b7a99578966eb691a961d9620ea38d235196b2f
# Merge: ed095412 7b0e3b19
# Author: Martin Grant <[email protected]>
# Date: Mon Jan 20 09:27:22 2025 +0000
# Merge pull request #2582 from przemektmalon/przemek/intel-host-usm-support
# Enable Host USM backed images on Level Zero
set(UNIFIED_RUNTIME_TAG 8b7a99578966eb691a961d9620ea38d235196b2f)
# commit b074893e854d28141cd67bc5935ed87e47eb3bb6
# Merge: 71a5eab0 128ea023
# Author: Ross Brunton <[email protected]>
# Date: Tue Jan 21 11:21:50 2025 +0000
# Merge pull request #2539 from RossBrunton/ross/specconst
#
# Added `DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS`
set(UNIFIED_RUNTIME_TAG b074893e854d28141cd67bc5935ed87e47eb3bb6)
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,15 @@ The second way to allocate image memory is to use USM allocations. SYCL already
provides a number of USM allocation functions. This proposal would add another,
pitched memory allocation, through `pitched_alloc_device`.

Bindless images can be backed by device, host, or shared USM memory allocations.

[NOTE]
====
Image memory backed by USM device and host allocations is generally supported,
whereas shared USM allocations depend on the SYCL backend as well as the device
capabilities.
====

```cpp
namespace sycl::ext::oneapi::experimental {

Expand Down Expand Up @@ -2328,4 +2337,5 @@ These features still need to be handled:
|6.4|2024-10-15| - Fix bindless spec examples and include examples in bindless
spec using asciidoc include.
|6.5|2024-10-22| - Allow 3-channel image formats on some backends.
|6.6|2025-01-20| - Clarify support for the specific types of USM allocations.
|======================
115 changes: 76 additions & 39 deletions sycl/include/sycl/handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2292,61 +2292,80 @@ class __SYCL_EXPORT handler {

template <typename KernelName = detail::auto_name, typename KernelType,
typename PropertiesT>
std::enable_if_t<
ext::oneapi::experimental::is_property_list<PropertiesT>::value>
single_task(PropertiesT Props, _KERNELFUNCPARAM(KernelFunc)) {
__SYCL_DEPRECATED(
"Use sycl::ext::oneapi::experimental::single_task (provided in the "
"sycl_ext_oneapi_enqueue_functions extension) instead.")
std::enable_if_t<ext::oneapi::experimental::is_property_list<
PropertiesT>::value> single_task(PropertiesT Props,
_KERNELFUNCPARAM(KernelFunc)) {
single_task_lambda_impl<KernelName, KernelType, PropertiesT>(Props,
KernelFunc);
}

template <typename KernelName = detail::auto_name, typename KernelType,
typename PropertiesT>
std::enable_if_t<
ext::oneapi::experimental::is_property_list<PropertiesT>::value>
parallel_for(range<1> NumWorkItems, PropertiesT Props,
_KERNELFUNCPARAM(KernelFunc)) {
__SYCL_DEPRECATED(
"Use sycl::ext::oneapi::experimental::single_task (provided in the "
"sycl_ext_oneapi_enqueue_functions extension) instead.")
std::enable_if_t<ext::oneapi::experimental::is_property_list<
PropertiesT>::value> parallel_for(range<1> NumWorkItems,
PropertiesT Props,
_KERNELFUNCPARAM(KernelFunc)) {
parallel_for_lambda_impl<KernelName, KernelType, 1, PropertiesT>(
NumWorkItems, Props, std::move(KernelFunc));
}

template <typename KernelName = detail::auto_name, typename KernelType,
typename PropertiesT>
std::enable_if_t<
ext::oneapi::experimental::is_property_list<PropertiesT>::value>
parallel_for(range<2> NumWorkItems, PropertiesT Props,
_KERNELFUNCPARAM(KernelFunc)) {
__SYCL_DEPRECATED(
"Use sycl::ext::oneapi::experimental::single_task (provided in the "
"sycl_ext_oneapi_enqueue_functions extension) instead.")
std::enable_if_t<ext::oneapi::experimental::is_property_list<
PropertiesT>::value> parallel_for(range<2> NumWorkItems,
PropertiesT Props,
_KERNELFUNCPARAM(KernelFunc)) {
parallel_for_lambda_impl<KernelName, KernelType, 2, PropertiesT>(
NumWorkItems, Props, std::move(KernelFunc));
}

template <typename KernelName = detail::auto_name, typename KernelType,
typename PropertiesT>
std::enable_if_t<
ext::oneapi::experimental::is_property_list<PropertiesT>::value>
parallel_for(range<3> NumWorkItems, PropertiesT Props,
_KERNELFUNCPARAM(KernelFunc)) {
__SYCL_DEPRECATED(
"Use sycl::ext::oneapi::experimental::single_task (provided in the "
"sycl_ext_oneapi_enqueue_functions extension) instead.")
std::enable_if_t<ext::oneapi::experimental::is_property_list<
PropertiesT>::value> parallel_for(range<3> NumWorkItems,
PropertiesT Props,
_KERNELFUNCPARAM(KernelFunc)) {
parallel_for_lambda_impl<KernelName, KernelType, 3, PropertiesT>(
NumWorkItems, Props, std::move(KernelFunc));
}

template <typename KernelName = detail::auto_name, typename KernelType,
typename PropertiesT, int Dims>
std::enable_if_t<
ext::oneapi::experimental::is_property_list<PropertiesT>::value>
parallel_for(nd_range<Dims> Range, PropertiesT Properties,
_KERNELFUNCPARAM(KernelFunc)) {
__SYCL_DEPRECATED(
"Use sycl::ext::oneapi::experimental::single_task (provided in the "
"sycl_ext_oneapi_enqueue_functions extension) instead.")
std::enable_if_t<ext::oneapi::experimental::is_property_list<
PropertiesT>::value> parallel_for(nd_range<Dims> Range,
PropertiesT Properties,
_KERNELFUNCPARAM(KernelFunc)) {
parallel_for_impl<KernelName>(Range, Properties, std::move(KernelFunc));
}

/// Reductions @{

template <typename KernelName = detail::auto_name, typename PropertiesT,
typename... RestT>
std::enable_if_t<
(sizeof...(RestT) > 1) &&
detail::AreAllButLastReductions<RestT...>::value &&
ext::oneapi::experimental::is_property_list<PropertiesT>::value>
parallel_for(range<1> Range, PropertiesT Properties, RestT &&...Rest) {
__SYCL_DEPRECATED(
"Use sycl::ext::oneapi::experimental::parallel_for (provided in the "
"sycl_ext_oneapi_enqueue_functions extension) instead.")
std::enable_if_t<(sizeof...(RestT) > 1) &&
detail::AreAllButLastReductions<RestT...>::value &&
ext::oneapi::experimental::is_property_list<
PropertiesT>::value> parallel_for(range<1> Range,
PropertiesT Properties,
RestT &&...Rest) {
#ifndef __SYCL_DEVICE_ONLY__
throwIfGraphAssociated<ext::oneapi::experimental::detail::
UnsupportedGraphFeatures::sycl_reductions>();
Expand All @@ -2357,11 +2376,15 @@ class __SYCL_EXPORT handler {

template <typename KernelName = detail::auto_name, typename PropertiesT,
typename... RestT>
std::enable_if_t<
(sizeof...(RestT) > 1) &&
detail::AreAllButLastReductions<RestT...>::value &&
ext::oneapi::experimental::is_property_list<PropertiesT>::value>
parallel_for(range<2> Range, PropertiesT Properties, RestT &&...Rest) {
__SYCL_DEPRECATED(
"Use sycl::ext::oneapi::experimental::parallel_for (provided in the "
"sycl_ext_oneapi_enqueue_functions extension) instead.")
std::enable_if_t<(sizeof...(RestT) > 1) &&
detail::AreAllButLastReductions<RestT...>::value &&
ext::oneapi::experimental::is_property_list<
PropertiesT>::value> parallel_for(range<2> Range,
PropertiesT Properties,
RestT &&...Rest) {
#ifndef __SYCL_DEVICE_ONLY__
throwIfGraphAssociated<ext::oneapi::experimental::detail::
UnsupportedGraphFeatures::sycl_reductions>();
Expand All @@ -2372,11 +2395,15 @@ class __SYCL_EXPORT handler {

template <typename KernelName = detail::auto_name, typename PropertiesT,
typename... RestT>
std::enable_if_t<
(sizeof...(RestT) > 1) &&
detail::AreAllButLastReductions<RestT...>::value &&
ext::oneapi::experimental::is_property_list<PropertiesT>::value>
parallel_for(range<3> Range, PropertiesT Properties, RestT &&...Rest) {
__SYCL_DEPRECATED(
"Use sycl::ext::oneapi::experimental::parallel_for (provided in the "
"sycl_ext_oneapi_enqueue_functions extension) instead.")
std::enable_if_t<(sizeof...(RestT) > 1) &&
detail::AreAllButLastReductions<RestT...>::value &&
ext::oneapi::experimental::is_property_list<
PropertiesT>::value> parallel_for(range<3> Range,
PropertiesT Properties,
RestT &&...Rest) {
#ifndef __SYCL_DEVICE_ONLY__
throwIfGraphAssociated<ext::oneapi::experimental::detail::
UnsupportedGraphFeatures::sycl_reductions>();
Expand Down Expand Up @@ -2411,11 +2438,15 @@ class __SYCL_EXPORT handler {

template <typename KernelName = detail::auto_name, int Dims,
typename PropertiesT, typename... RestT>
std::enable_if_t<
(sizeof...(RestT) > 1) &&
detail::AreAllButLastReductions<RestT...>::value &&
ext::oneapi::experimental::is_property_list<PropertiesT>::value>
parallel_for(nd_range<Dims> Range, PropertiesT Properties, RestT &&...Rest) {
__SYCL_DEPRECATED(
"Use sycl::ext::oneapi::experimental::parallel_for (provided in the "
"sycl_ext_oneapi_enqueue_functions extension) instead.")
std::enable_if_t<(sizeof...(RestT) > 1) &&
detail::AreAllButLastReductions<RestT...>::value &&
ext::oneapi::experimental::is_property_list<
PropertiesT>::value> parallel_for(nd_range<Dims> Range,
PropertiesT Properties,
RestT &&...Rest) {
#ifndef __SYCL_DEVICE_ONLY__
throwIfGraphAssociated<ext::oneapi::experimental::detail::
UnsupportedGraphFeatures::sycl_reductions>();
Expand All @@ -2437,6 +2468,9 @@ class __SYCL_EXPORT handler {

template <typename KernelName = detail::auto_name, typename KernelType,
int Dims, typename PropertiesT>
__SYCL_DEPRECATED(
"Use sycl::ext::oneapi::experimental::parallel_for (provided in the "
"sycl_ext_oneapi_enqueue_functions extension) instead.")
void parallel_for_work_group(range<Dims> NumWorkGroups, PropertiesT Props,
_KERNELFUNCPARAM(KernelFunc)) {
parallel_for_work_group_lambda_impl<KernelName, KernelType, Dims,
Expand All @@ -2446,6 +2480,9 @@ class __SYCL_EXPORT handler {

template <typename KernelName = detail::auto_name, typename KernelType,
int Dims, typename PropertiesT>
__SYCL_DEPRECATED(
"Use sycl::ext::oneapi::experimental::parallel_for (provided in the "
"sycl_ext_oneapi_enqueue_functions extension) instead.")
void parallel_for_work_group(range<Dims> NumWorkGroups,
range<Dims> WorkGroupSize, PropertiesT Props,
_KERNELFUNCPARAM(KernelFunc)) {
Expand Down
Loading

0 comments on commit 153c9f1

Please sign in to comment.