Skip to content

Commit 259c433

Browse files
[SYCL][ABI-Break] Drop old enqueue functions from handler (#20744)
1 parent 282e8cc commit 259c433

File tree

4 files changed

+0
-246
lines changed

4 files changed

+0
-246
lines changed

sycl/include/sycl/handler.hpp

Lines changed: 0 additions & 235 deletions
Original file line numberDiff line numberDiff line change
@@ -471,27 +471,8 @@ class __SYCL_EXPORT handler {
471471
/// Extracts and prepares kernel arguments set via set_arg(s).
472472
void extractArgsAndReqs();
473473

474-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
475-
/// \return a string containing name of SYCL kernel.
476-
detail::ABINeutralKernelNameStrT getKernelName();
477-
478-
template <typename LambdaNameT> bool lambdaAndKernelHaveEqualName() {
479-
// TODO It is unclear a kernel and a lambda/functor must to be equal or not
480-
// for parallel_for with sycl::kernel and lambda/functor together
481-
// Now if they are equal we extract arguments from lambda/functor for the
482-
// kernel. Else it is necessary use set_atg(s) for resolve the order and
483-
// values of arguments for the kernel.
484-
assert(MKernel && "MKernel is not initialized");
485-
constexpr std::string_view LambdaName =
486-
detail::CompileTimeKernelInfo<LambdaNameT>.Name;
487-
detail::ABINeutralKernelNameStrT KernelName = getKernelName();
488-
return KernelName == LambdaName;
489-
}
490-
#endif
491-
492474
/// Saves the location of user's code passed in \p CodeLoc for future usage in
493475
/// finalize() method.
494-
495476
void saveCodeLoc(detail::code_location CodeLoc, bool IsTopCodeLoc);
496477
void copyCodeLoc(const handler &other);
497478

@@ -1248,64 +1229,6 @@ class __SYCL_EXPORT handler {
12481229
#endif
12491230
}
12501231

1251-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
1252-
// Implementation for something that had to be removed long ago but now stuck
1253-
// until next major release...
1254-
template <
1255-
detail::WrapAs WrapAsVal, typename KernelName,
1256-
typename ElementType = void, int Dims = 1, bool SetNumWorkGroups = false,
1257-
typename PropertiesT = ext::oneapi::experimental::empty_properties_t,
1258-
typename KernelType, typename... RangeParams>
1259-
void wrap_kernel_legacy(const KernelType &KernelFunc, kernel &Kernel,
1260-
const PropertiesT &Props,
1261-
[[maybe_unused]] RangeParams &&...params) {
1262-
// TODO: Properties may change the kernel function, so in order to avoid
1263-
// conflicts they should be included in the name.
1264-
using NameT =
1265-
typename detail::get_kernel_name_t<KernelName, KernelType>::name;
1266-
(void)Props;
1267-
(void)Kernel;
1268-
detail::KernelWrapper<WrapAsVal, NameT, KernelType, ElementType,
1269-
PropertiesT>::wrap(KernelFunc);
1270-
1271-
if constexpr (ext::oneapi::experimental::detail::
1272-
HasKernelPropertiesGetMethod<const KernelType &>::value) {
1273-
SetKernelLaunchpropertiesIfNotEmpty(detail::extractKernelProperties(
1274-
KernelFunc.get(ext::oneapi::experimental::properties_tag{})));
1275-
}
1276-
1277-
#ifndef __SYCL_DEVICE_ONLY__
1278-
constexpr auto Info = detail::CompileTimeKernelInfo<NameT>;
1279-
if constexpr (WrapAsVal == detail::WrapAs::single_task) {
1280-
throwOnKernelParameterMisuse(Info);
1281-
}
1282-
throwIfActionIsCreated();
1283-
// Ignore any set kernel bundles and use the one associated with the
1284-
// kernel.
1285-
setHandlerKernelBundle(Kernel);
1286-
verifyUsedKernelBundleInternal(Info.Name);
1287-
1288-
detail::checkValueRange<Dims>(params...);
1289-
if constexpr (SetNumWorkGroups) {
1290-
setNDRangeDescriptor(std::move(params)...,
1291-
/*SetNumWorkGroups=*/true);
1292-
} else {
1293-
setNDRangeDescriptor(std::move(params)...);
1294-
}
1295-
1296-
MKernel = detail::getSyclObjImpl(Kernel);
1297-
if (!lambdaAndKernelHaveEqualName<NameT>()) {
1298-
throw sycl::exception(
1299-
make_error_code(errc::invalid),
1300-
"the kernel name must match the name of the lambda");
1301-
}
1302-
StoreLambda<NameT, KernelType, Dims, ElementType>(std::move(KernelFunc));
1303-
SetKernelLaunchpropertiesIfNotEmpty(
1304-
detail::extractKernelProperties<Info.IsESIMD>(Props));
1305-
#endif
1306-
}
1307-
#endif // __INTEL_PREVIEW_BREAKING_CHANGES
1308-
13091232
// NOTE: to support kernel_handler argument in kernel lambdas, only
13101233
// detail::KernelWrapper<...>::wrap() must be called in this code.
13111234

@@ -1723,164 +1646,6 @@ class __SYCL_EXPORT handler {
17231646
Kernel);
17241647
}
17251648

1726-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
1727-
// Implementation for something that had to be removed long ago but now stuck
1728-
// until next major release...
1729-
1730-
/// Defines and invokes a SYCL kernel function.
1731-
///
1732-
/// \param Kernel is a SYCL kernel that is executed on a SYCL device
1733-
/// (except for the host device).
1734-
/// \param KernelFunc is a lambda that is used if device, queue is bound to,
1735-
/// is a host device.
1736-
template <typename KernelName = detail::auto_name, typename KernelType>
1737-
__SYCL_DEPRECATED("This overload isn't part of SYCL2020 and will be removed.")
1738-
void single_task(kernel Kernel, const KernelType &KernelFunc) {
1739-
// Ignore any set kernel bundles and use the one associated with the kernel
1740-
setHandlerKernelBundle(Kernel);
1741-
using NameT =
1742-
typename detail::get_kernel_name_t<KernelName, KernelType>::name;
1743-
(void)Kernel;
1744-
detail::KernelWrapperHelperFuncs::kernel_single_task<NameT>(KernelFunc);
1745-
#ifndef __SYCL_DEVICE_ONLY__
1746-
throwIfActionIsCreated();
1747-
constexpr auto Info = detail::CompileTimeKernelInfo<NameT>;
1748-
verifyUsedKernelBundleInternal(Info.Name);
1749-
// No need to check if range is out of INT_MAX limits as it's compile-time
1750-
// known constant
1751-
setNDRangeDescriptor(range<1>{1});
1752-
1753-
MKernel = detail::getSyclObjImpl(Kernel);
1754-
if (!lambdaAndKernelHaveEqualName<NameT>()) {
1755-
throw sycl::exception(
1756-
make_error_code(errc::invalid),
1757-
"the kernel name must match the name of the lambda");
1758-
}
1759-
StoreLambda<NameT, KernelType, /*Dims*/ 1, void>(std::move(KernelFunc));
1760-
1761-
#else
1762-
detail::CheckDeviceCopyable<KernelType>();
1763-
#endif
1764-
}
1765-
#endif // __INTEL_PREVIEW_BREAKING_CHANGES
1766-
1767-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
1768-
/// Defines and invokes a SYCL kernel function for the specified range.
1769-
///
1770-
/// \param Kernel is a SYCL kernel that is executed on a SYCL device
1771-
/// (except for the host device).
1772-
/// \param NumWorkItems is a range defining indexing space.
1773-
/// \param KernelFunc is a lambda that is used if device, queue is bound to,
1774-
/// is a host device.
1775-
template <typename KernelName = detail::auto_name, typename KernelType,
1776-
int Dims>
1777-
__SYCL_DEPRECATED("This overload isn't part of SYCL2020 and will be removed.")
1778-
void parallel_for(kernel Kernel, range<Dims> NumWorkItems,
1779-
const KernelType &KernelFunc) {
1780-
// Ignore any set kernel bundles and use the one associated with the kernel
1781-
setHandlerKernelBundle(Kernel);
1782-
using LambdaArgType = sycl::detail::lambda_arg_type<KernelType, item<Dims>>;
1783-
wrap_kernel_legacy<detail::WrapAs::parallel_for, KernelName, LambdaArgType,
1784-
Dims>(KernelFunc, Kernel, {} /*Props*/, NumWorkItems);
1785-
}
1786-
1787-
/// Defines and invokes a SYCL kernel function for the specified range and
1788-
/// offsets.
1789-
///
1790-
/// \param Kernel is a SYCL kernel that is executed on a SYCL device
1791-
/// (except for the host device).
1792-
/// \param NumWorkItems is a range defining indexing space.
1793-
/// \param WorkItemOffset is an offset to be applied to each work item index.
1794-
/// \param KernelFunc is a lambda that is used if device, queue is bound to,
1795-
/// is a host device.
1796-
template <typename KernelName = detail::auto_name, typename KernelType,
1797-
int Dims>
1798-
__SYCL_DEPRECATED("This overload isn't part of SYCL2020 and will be removed.")
1799-
void parallel_for(kernel Kernel, range<Dims> NumWorkItems,
1800-
id<Dims> WorkItemOffset, const KernelType &KernelFunc) {
1801-
using LambdaArgType = sycl::detail::lambda_arg_type<KernelType, item<Dims>>;
1802-
wrap_kernel_legacy<detail::WrapAs::parallel_for, KernelName, LambdaArgType,
1803-
Dims>(KernelFunc, Kernel, {} /*Props*/, NumWorkItems,
1804-
WorkItemOffset);
1805-
}
1806-
1807-
/// Defines and invokes a SYCL kernel function for the specified range and
1808-
/// offsets.
1809-
///
1810-
/// \param Kernel is a SYCL kernel that is executed on a SYCL device
1811-
/// (except for the host device).
1812-
/// \param NDRange is a ND-range defining global and local sizes as
1813-
/// well as offset.
1814-
/// \param KernelFunc is a lambda that is used if device, queue is bound to,
1815-
/// is a host device.
1816-
template <typename KernelName = detail::auto_name, typename KernelType,
1817-
int Dims>
1818-
__SYCL_DEPRECATED("This overload isn't part of SYCL2020 and will be removed.")
1819-
void parallel_for(kernel Kernel, nd_range<Dims> NDRange,
1820-
const KernelType &KernelFunc) {
1821-
using LambdaArgType =
1822-
sycl::detail::lambda_arg_type<KernelType, nd_item<Dims>>;
1823-
wrap_kernel_legacy<detail::WrapAs::parallel_for, KernelName, LambdaArgType,
1824-
Dims>(KernelFunc, Kernel, {} /*Props*/, NDRange);
1825-
}
1826-
1827-
/// Hierarchical kernel invocation method of a kernel.
1828-
///
1829-
/// This version of \c parallel_for_work_group takes two parameters
1830-
/// representing the same kernel. The first one - \c Kernel - is a
1831-
/// compiled form of the second one - \c kernelFunc, which is the source form
1832-
/// of the kernel. The same source kernel can be compiled multiple times
1833-
/// yielding multiple kernel class objects accessible via the \c program class
1834-
/// interface.
1835-
///
1836-
/// \param Kernel is a compiled SYCL kernel.
1837-
/// \param NumWorkGroups is a range describing the number of work-groups in
1838-
/// each dimension.
1839-
/// \param KernelFunc is a lambda representing kernel.
1840-
template <typename KernelName = detail::auto_name, typename KernelType,
1841-
int Dims>
1842-
__SYCL_DEPRECATED("This overload isn't part of SYCL2020 and will be removed.")
1843-
void parallel_for_work_group(kernel Kernel, range<Dims> NumWorkGroups,
1844-
const KernelType &KernelFunc) {
1845-
using LambdaArgType =
1846-
sycl::detail::lambda_arg_type<KernelType, group<Dims>>;
1847-
wrap_kernel_legacy<detail::WrapAs::parallel_for_work_group, KernelName,
1848-
LambdaArgType, Dims,
1849-
/*SetNumWorkGroups*/ true>(KernelFunc, Kernel,
1850-
{} /*Props*/, NumWorkGroups);
1851-
}
1852-
1853-
/// Hierarchical kernel invocation method of a kernel.
1854-
///
1855-
/// This version of \c parallel_for_work_group takes two parameters
1856-
/// representing the same kernel. The first one - \c Kernel - is a
1857-
/// compiled form of the second one - \c kernelFunc, which is the source form
1858-
/// of the kernel. The same source kernel can be compiled multiple times
1859-
/// yielding multiple kernel class objects accessible via the \c program class
1860-
/// interface.
1861-
///
1862-
/// \param Kernel is a compiled SYCL kernel.
1863-
/// \param NumWorkGroups is a range describing the number of work-groups in
1864-
/// each dimension.
1865-
/// \param WorkGroupSize is a range describing the size of work-groups in
1866-
/// each dimension.
1867-
/// \param KernelFunc is a lambda representing kernel.
1868-
template <typename KernelName = detail::auto_name, typename KernelType,
1869-
int Dims>
1870-
__SYCL_DEPRECATED("This overload isn't part of SYCL2020 and will be removed.")
1871-
void parallel_for_work_group(kernel Kernel, range<Dims> NumWorkGroups,
1872-
range<Dims> WorkGroupSize,
1873-
const KernelType &KernelFunc) {
1874-
using LambdaArgType =
1875-
sycl::detail::lambda_arg_type<KernelType, group<Dims>>;
1876-
nd_range<Dims> ExecRange =
1877-
nd_range<Dims>(NumWorkGroups * WorkGroupSize, WorkGroupSize);
1878-
wrap_kernel_legacy<detail::WrapAs::parallel_for_work_group, KernelName,
1879-
LambdaArgType, Dims>(KernelFunc, Kernel, {} /*Props*/,
1880-
ExecRange);
1881-
}
1882-
#endif // __INTEL_PREVIEW_BREAKING_CHANGES
1883-
18841649
template <typename KernelName = detail::auto_name, typename KernelType,
18851650
typename PropertiesT>
18861651
__SYCL_DEPRECATED("To specify properties, use a launch configuration object "

sycl/source/handler.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -869,15 +869,6 @@ void handler::extractArgsAndReqs() {
869869
impl->MKernelData.extractArgsAndReqs(MKernel->isCreatedFromSource());
870870
}
871871

872-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
873-
// Calling methods of kernel_impl requires knowledge of class layout.
874-
// As this is impossible in header, there's a function that calls necessary
875-
// method inside the library and returns the result.
876-
detail::ABINeutralKernelNameStrT handler::getKernelName() {
877-
return MKernel->getName();
878-
}
879-
#endif
880-
881872
void handler::verifyUsedKernelBundleInternal(detail::string_view KernelName) {
882873
detail::kernel_bundle_impl *UsedKernelBundleImplPtr =
883874
getOrInsertHandlerKernelBundlePtr(/*Insert=*/false);

sycl/test/abi/sycl_symbols_linux.dump

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3529,7 +3529,6 @@ _ZN4sycl3_V17handler11storeRawArgEPKvm
35293529
_ZN4sycl3_V17handler12addReductionERKSt10shared_ptrIKvE
35303530
_ZN4sycl3_V17handler12setArgHelperEiONS0_6streamE
35313531
_ZN4sycl3_V17handler12setArgHelperEiRNS0_6detail22work_group_memory_implE
3532-
_ZN4sycl3_V17handler13getKernelNameEv
35333532
_ZN4sycl3_V17handler13setKernelFuncEPv
35343533
_ZN4sycl3_V17handler15ext_oneapi_copyENS0_3ext6oneapi12experimental16image_mem_handleENS0_5rangeILi3EEERKNS4_16image_descriptorEPvS7_S7_S7_
35353534
_ZN4sycl3_V17handler15ext_oneapi_copyENS0_3ext6oneapi12experimental16image_mem_handleENS0_5rangeILi3EEERKNS4_16image_descriptorEPvS7_SA_mS7_

sycl/test/abi/sycl_symbols_windows.dump

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4031,7 +4031,6 @@
40314031
?getElementSize@image_plain@detail@_V1@sycl@@IEBA_KXZ
40324032
?getEndTime@HostProfilingInfo@detail@_V1@sycl@@QEBA_KXZ
40334033
?getKernelBundle@handler@_V1@sycl@@AEBA?AV?$kernel_bundle@$0A@@23@XZ
4034-
?getKernelName@handler@_V1@sycl@@AEAA?AVstring@detail@23@XZ
40354034
?getMaxWorkGroups@handler@_V1@sycl@@AEAA?AV?$optional@V?$array@_K$02@std@@@std@@XZ
40364035
?getMaxWorkGroups_v2@handler@_V1@sycl@@AEAA?AV?$tuple@V?$array@_K$02@std@@_N@std@@XZ
40374036
?getMemoryObject@AccessorBaseHost@detail@_V1@sycl@@QEBAPEAXXZ

0 commit comments

Comments
 (0)