Skip to content

Commit 4cb0518

Browse files
[ABI Break][SYCL] Remove deprecated is_host() for SYCL objects and related handler ctor param (#14258)
Host device support is deprecated long time ago. Removes: 1) is_host() API deprecated long time ago, SYCL2020 deprecations group. 2) remove isHost ctor param and corresponding field from handler class. Handler instance is always created by RT. User deals with handler instance by creating kernel lambda which accepts handler as parameter and then calls methods of handler. --------- Signed-off-by: Tikhomirova, Kseniya <[email protected]>
1 parent 7a7619d commit 4cb0518

38 files changed

+48
-334
lines changed

sycl/include/sycl/context.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,6 @@ class __SYCL_EXPORT context : public detail::OwnerLessBase<context> {
215215
cl_context get() const;
216216
#endif
217217

218-
/// Checks if this context is a SYCL host context.
219-
///
220-
/// \return true if this context is a SYCL host context.
221-
__SYCL2020_DEPRECATED(
222-
"is_host() is deprecated as the host device is no longer supported.")
223-
bool is_host() const;
224-
225218
/// Returns the backend associated with this context.
226219
///
227220
/// \return the backend associated with this context.

sycl/include/sycl/detail/image_accessor_util.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
8-
// This file includes some utilities that are used by image accessors on host
9-
// device
8+
// This file includes some utilities that are used by image accessors in host
9+
// code
1010
//
1111

1212
#pragma once
@@ -685,7 +685,7 @@ convertWriteData(const half4 WriteData,
685685
}
686686

687687
// imageWriteHostImpl method is called by the write API in image accessors for
688-
// host device. Steps:
688+
// host code. Steps:
689689
// 1. Calculates the offset from the base ptr of the image where the pixel
690690
// denoted by Coord is located.(getImageOffset method.)
691691
// 2. Converts the ptr to the appropriate datatype based on

sycl/include/sycl/device.hpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,6 @@ class __SYCL_EXPORT device : public detail::OwnerLessBase<device> {
119119
cl_device_id get() const;
120120
#endif
121121

122-
/// Check if device is a host device
123-
///
124-
/// \return true if SYCL device is a host device
125-
__SYCL2020_DEPRECATED(
126-
"is_host() is deprecated as the host device is no longer supported.")
127-
bool is_host() const;
128-
129122
/// Check if device is a CPU device
130123
///
131124
/// \return true if SYCL device is a CPU device
@@ -145,8 +138,7 @@ class __SYCL_EXPORT device : public detail::OwnerLessBase<device> {
145138
///
146139
/// If this SYCL device is an OpenCL device then the SYCL platform
147140
/// must encapsulate the OpenCL cl_plaform_id associated with the
148-
/// underlying OpenCL cl_device_id of this SYCL device. If this SYCL device
149-
/// is a host device then the SYCL platform must be a host platform.
141+
/// underlying OpenCL cl_device_id of this SYCL device.
150142
/// The value returned must be equal to that returned by
151143
/// get_info<info::device::platform>().
152144
///
@@ -240,9 +232,6 @@ class __SYCL_EXPORT device : public detail::OwnerLessBase<device> {
240232

241233
/// Query available SYCL devices
242234
///
243-
/// The returned std::vector must contain a single SYCL device
244-
/// that is a host device, permitted by the deviceType parameter
245-
///
246235
/// \param deviceType is one of the values described in A.3 of SYCL Spec
247236
/// \return a std::vector containing all SYCL devices available in the system
248237
/// of the device type specified

sycl/include/sycl/device_selector.hpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,6 @@ __SYCL2020_DEPRECATED("Use the callable sycl::accelerator_selector_v instead.")
9494
int operator()(const device &dev) const override;
9595
};
9696

97-
/// Selects SYCL host device.
98-
///
99-
/// \sa device
100-
///
101-
/// \ingroup sycl_api_dev_sel
102-
class __SYCL_EXPORT
103-
__SYCL2020_DEPRECATED("Host device is no longer supported.") host_selector
104-
: public device_selector {
105-
public:
106-
int operator()(const device &dev) const override;
107-
};
108-
10997
// -------------- SYCL 2020
11098

11199
// SYCL 2020 standalone selectors

sycl/include/sycl/event.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,6 @@ class __SYCL_EXPORT event : public detail::OwnerLessBase<event> {
7070

7171
bool operator!=(const event &rhs) const;
7272

73-
/// Checks if this event is a SYCL host event.
74-
///
75-
/// \return true if this event is a SYCL host event.
76-
__SYCL2020_DEPRECATED(
77-
"is_host() is deprecated as the host device is no longer supported.")
78-
bool is_host() const;
79-
8073
/// Return the list of events that this event waits for.
8174
///
8275
/// Only direct dependencies are returned. Already completed events are not

sycl/include/sycl/group_barrier.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ group_barrier(Group G, memory_scope FenceScope = Group::fence_scope) {
3131
(void)G;
3232
(void)FenceScope;
3333
throw sycl::exception(make_error_code(errc::feature_not_supported),
34-
"Barriers are not supported on host device");
34+
"Barriers are not supported on host");
3535
#endif
3636
}
3737

sycl/include/sycl/handler.hpp

Lines changed: 2 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -465,32 +465,9 @@ class __SYCL_EXPORT handler {
465465
/// Constructs SYCL handler from queue.
466466
///
467467
/// \param Queue is a SYCL queue.
468-
/// \param IsHost indicates if this handler is created for SYCL host device.
469-
/// TODO: Unused. Remove with ABI break.
470-
handler(std::shared_ptr<detail::queue_impl> Queue, bool /*Unused*/);
471-
472-
/// Constructs SYCL handler from the associated queue and the submission's
473-
/// primary and secondary queue.
474-
///
475-
/// \param Queue is a SYCL queue. This is equal to either PrimaryQueue or
476-
/// SecondaryQueue.
477-
/// \param PrimaryQueue is the primary SYCL queue of the submission.
478-
/// \param SecondaryQueue is the secondary SYCL queue of the submission. This
479-
/// is null if no secondary queue is associated with the submission.
480-
/// TODO: Unused. Remove with ABI break.
481-
handler(std::shared_ptr<detail::queue_impl> Queue,
482-
std::shared_ptr<detail::queue_impl> PrimaryQueue,
483-
std::shared_ptr<detail::queue_impl> SecondaryQueue,
484-
bool /* Unused */);
485-
486-
/// Constructs SYCL handler from queue.
487-
///
488-
/// \param Queue is a SYCL queue.
489-
/// \param IsHost indicates if this handler is created for SYCL host device.
490468
/// \param CallerNeedsEvent indicates if the event resulting from this handler
491469
/// is needed by the caller.
492-
handler(std::shared_ptr<detail::queue_impl> Queue,
493-
bool /* ABI break: remove */, bool CallerNeedsEvent);
470+
handler(std::shared_ptr<detail::queue_impl> Queue, bool CallerNeedsEvent);
494471

495472
/// Constructs SYCL handler from the associated queue and the submission's
496473
/// primary and secondary queue.
@@ -500,13 +477,12 @@ class __SYCL_EXPORT handler {
500477
/// \param PrimaryQueue is the primary SYCL queue of the submission.
501478
/// \param SecondaryQueue is the secondary SYCL queue of the submission. This
502479
/// is null if no secondary queue is associated with the submission.
503-
/// \param IsHost indicates if this handler is created for SYCL host device.
504480
/// \param CallerNeedsEvent indicates if the event resulting from this handler
505481
/// is needed by the caller.
506482
handler(std::shared_ptr<detail::queue_impl> Queue,
507483
std::shared_ptr<detail::queue_impl> PrimaryQueue,
508484
std::shared_ptr<detail::queue_impl> SecondaryQueue,
509-
bool /* ABI break: remove */, bool CallerNeedsEvent);
485+
bool CallerNeedsEvent);
510486

511487
/// Constructs SYCL handler from Graph.
512488
///
@@ -652,9 +628,6 @@ class __SYCL_EXPORT handler {
652628

653629
~handler() = default;
654630

655-
// TODO: Private and unusued. Remove when ABI break is allowed.
656-
bool is_host() { return false; }
657-
658631
#ifdef __SYCL_DEVICE_ONLY__
659632
// In device compilation accessor isn't inherited from host base classes, so
660633
// can't detect by it. Since we don't expect it to be ever called in device
@@ -784,12 +757,6 @@ class __SYCL_EXPORT handler {
784757
&DynamicParamBase,
785758
int ArgIndex);
786759

787-
// TODO: Unusued. Remove when ABI break is allowed.
788-
void verifyKernelInvoc(const kernel &Kernel) {
789-
std::ignore = Kernel;
790-
return;
791-
}
792-
793760
/* The kernel passed to StoreLambda can take an id, an item or an nd_item as
794761
* its argument. Since esimd plugin directly invokes the kernel (doesn’t use
795762
* piKernelSetArg), the kernel argument type must be known to the plugin.
@@ -1110,7 +1077,6 @@ class __SYCL_EXPORT handler {
11101077
///
11111078
/// \param Src is a source SYCL accessor.
11121079
/// \param Dst is a destination SYCL accessor.
1113-
// ABI break: to remove whole method
11141080
template <typename TSrc, int DimSrc, access::mode ModeSrc,
11151081
access::target TargetSrc, typename TDst, int DimDst,
11161082
access::mode ModeDst, access::target TargetDst,
@@ -1121,81 +1087,6 @@ class __SYCL_EXPORT handler {
11211087
return false;
11221088
}
11231089

1124-
#ifndef __SYCL_DEVICE_ONLY__
1125-
// ABI break: to remove whole method
1126-
/// Copies the content of memory object accessed by Src into the memory
1127-
/// pointed by Dst.
1128-
///
1129-
/// \param Src is a source SYCL accessor.
1130-
/// \param Dst is a pointer to destination memory.
1131-
template <typename TSrc, typename TDst, int Dim, access::mode AccMode,
1132-
access::target AccTarget, access::placeholder IsPH>
1133-
std::enable_if_t<(Dim > 0)>
1134-
copyAccToPtrHost(accessor<TSrc, Dim, AccMode, AccTarget, IsPH> Src,
1135-
TDst *Dst) {
1136-
range<Dim> Range = Src.get_range();
1137-
parallel_for<__copyAcc2Ptr<TSrc, TDst, Dim, AccMode, AccTarget, IsPH>>(
1138-
Range, [=](id<Dim> Index) {
1139-
const size_t LinearIndex = detail::getLinearIndex(Index, Range);
1140-
using TSrcNonConst = typename std::remove_const_t<TSrc>;
1141-
(reinterpret_cast<TSrcNonConst *>(Dst))[LinearIndex] = Src[Index];
1142-
});
1143-
}
1144-
1145-
// ABI break: to remove whole method
1146-
/// Copies 1 element accessed by 0-dimensional accessor Src into the memory
1147-
/// pointed by Dst.
1148-
///
1149-
/// \param Src is a source SYCL accessor.
1150-
/// \param Dst is a pointer to destination memory.
1151-
template <typename TSrc, typename TDst, int Dim, access::mode AccMode,
1152-
access::target AccTarget, access::placeholder IsPH>
1153-
std::enable_if_t<Dim == 0>
1154-
copyAccToPtrHost(accessor<TSrc, Dim, AccMode, AccTarget, IsPH> Src,
1155-
TDst *Dst) {
1156-
single_task<__copyAcc2Ptr<TSrc, TDst, Dim, AccMode, AccTarget, IsPH>>(
1157-
[=]() {
1158-
using TSrcNonConst = typename std::remove_const_t<TSrc>;
1159-
*(reinterpret_cast<TSrcNonConst *>(Dst)) = *(Src.get_pointer());
1160-
});
1161-
}
1162-
1163-
// ABI break: to remove whole method
1164-
/// Copies the memory pointed by Src into the memory accessed by Dst.
1165-
///
1166-
/// \param Src is a pointer to source memory.
1167-
/// \param Dst is a destination SYCL accessor.
1168-
template <typename TSrc, typename TDst, int Dim, access::mode AccMode,
1169-
access::target AccTarget, access::placeholder IsPH>
1170-
std::enable_if_t<(Dim > 0)>
1171-
copyPtrToAccHost(TSrc *Src,
1172-
accessor<TDst, Dim, AccMode, AccTarget, IsPH> Dst) {
1173-
range<Dim> Range = Dst.get_range();
1174-
parallel_for<__copyPtr2Acc<TSrc, TDst, Dim, AccMode, AccTarget, IsPH>>(
1175-
Range, [=](id<Dim> Index) {
1176-
const size_t LinearIndex = detail::getLinearIndex(Index, Range);
1177-
Dst[Index] = (reinterpret_cast<const TDst *>(Src))[LinearIndex];
1178-
});
1179-
}
1180-
1181-
// ABI break: to remove whole method
1182-
/// Copies 1 element pointed by Src to memory accessed by 0-dimensional
1183-
/// accessor Dst.
1184-
///
1185-
/// \param Src is a pointer to source memory.
1186-
/// \param Dst is a destination SYCL accessor.
1187-
template <typename TSrc, typename TDst, int Dim, access::mode AccMode,
1188-
access::target AccTarget, access::placeholder IsPH>
1189-
std::enable_if_t<Dim == 0>
1190-
copyPtrToAccHost(TSrc *Src,
1191-
accessor<TDst, Dim, AccMode, AccTarget, IsPH> Dst) {
1192-
single_task<__copyPtr2Acc<TSrc, TDst, Dim, AccMode, AccTarget, IsPH>>(
1193-
[=]() {
1194-
*(Dst.get_pointer()) = *(reinterpret_cast<const TDst *>(Src));
1195-
});
1196-
}
1197-
#endif // __SYCL_DEVICE_ONLY__
1198-
11991090
constexpr static bool isConstOrGlobal(access::target AccessTarget) {
12001091
return AccessTarget == access::target::device ||
12011092
AccessTarget == access::target::constant_buffer;
@@ -3426,8 +3317,6 @@ class __SYCL_EXPORT handler {
34263317
/// Storage for the CG created when handling graph nodes added explicitly.
34273318
std::unique_ptr<detail::CG> MGraphNodeCG;
34283319

3429-
bool MIsHost = false; // ABI break: to remove
3430-
34313320
detail::code_location MCodeLoc = {};
34323321
bool MIsFinalized = false;
34333322
event MLastEvent;

sycl/include/sycl/kernel.hpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,21 +101,13 @@ class __SYCL_EXPORT kernel : public detail::OwnerLessBase<kernel> {
101101
/// Get a valid OpenCL kernel handle
102102
///
103103
/// If this kernel encapsulates an instance of OpenCL kernel, a valid
104-
/// cl_kernel will be returned. If this kernel is a host kernel,
105-
/// an invalid_object_error exception will be thrown.
104+
/// cl_kernel will be returned.
106105
///
107106
/// \return a valid cl_kernel instance
108107
#ifdef __SYCL_INTERNAL_API
109108
cl_kernel get() const;
110109
#endif
111110

112-
/// Check if the associated SYCL context is a SYCL host context.
113-
///
114-
/// \return true if this SYCL kernel is a host kernel.
115-
__SYCL2020_DEPRECATED(
116-
"is_host() is deprecated as the host device is no longer supported.")
117-
bool is_host() const;
118-
119111
/// Get the context that this kernel is defined for.
120112
///
121113
/// The value returned must be equal to that returned by

sycl/include/sycl/kernel_handler.hpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,9 @@ class __SYCL_TYPE(kernel_handler) kernel_handler {
4949
#ifdef __SYCL_DEVICE_ONLY__
5050
return getSpecializationConstantOnDevice<S>();
5151
#else
52-
// TODO: add support of host device
53-
throw sycl::feature_not_supported(
54-
"kernel_handler::get_specialization_constant() is not yet supported by "
55-
"host device.",
56-
PI_ERROR_INVALID_OPERATION);
52+
throw sycl::feature_not_supported("kernel_handler::get_specialization_"
53+
"constant() is not supported on host",
54+
PI_ERROR_INVALID_OPERATION);
5755
#endif // __SYCL_DEVICE_ONLY__
5856
}
5957

sycl/include/sycl/platform.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,6 @@ class __SYCL_EXPORT platform : public detail::OwnerLessBase<platform> {
159159
"use platform::has() function with aspects APIs instead")
160160
bool has_extension(const std::string &ExtensionName) const;
161161

162-
/// Checks if this SYCL platform is a host platform.
163-
///
164-
/// \return true if this SYCL platform is a host platform.
165-
__SYCL2020_DEPRECATED(
166-
"is_host() is deprecated as the host device is no longer supported.")
167-
bool is_host() const;
168-
169162
/// Returns all SYCL devices associated with this platform.
170163
///
171164
/// If this SYCL platform is a host platform, resulting vector contains only

0 commit comments

Comments
 (0)