Skip to content

Commit e32e5c5

Browse files
author
Alexander Batashev
authored
[SYCL] Remove _class aliases (#4465)
1 parent 8dddb11 commit e32e5c5

25 files changed

+95
-126
lines changed

sycl/doc/extensions/EnqueueBarrier/enqueue_barrier.asciidoc

+8-8
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ two new members to the `queue` class:
8888
|========================================
8989
|*handler::ext_oneapi_barrier*|*queue::ext_oneapi_submit_barrier*
9090
|`void ext_oneapi_barrier()` | `event ext_oneapi_submit_barrier()`
91-
|`void ext_oneapi_barrier( const vector_class<event> &waitList )` | `event ext_oneapi_submit_barrier( const vector_class<event> &waitList )`
91+
|`void ext_oneapi_barrier( const std::vector<event> &waitList )` | `event ext_oneapi_submit_barrier( const std::vector<event> &waitList )`
9292
|========================================
9393

9494
The first variant of the barrier takes no parameters, and waits for all previously submitted commands to the queue to enter the `info::event_command_status::complete` state before any command later submitted to the same queue is allowed to execute. A second variant of the barrier accepts a list of events, with the behavior that no commands submitted to the same queue after barrier submission may execute until all events in the `waitList` have entered the `info::event_command_status::complete` state. Both variants are non-blocking from the host program perspective, in that they do not wait for the barrier conditions to have been met before returning.
@@ -171,7 +171,7 @@ auto event_barrier2 = Queue2.submit([&](cl::sycl::handler& cgh) {
171171
});
172172
173173
Queue3.submit([&](cl::sycl::handler& cgh) {
174-
cgh.ext_oneapi_barrier( vector_class<event>{event_barrier1, event_barrier2} );
174+
cgh.ext_oneapi_barrier( std::vector<event>{event_barrier1, event_barrier2} );
175175
});
176176
177177
Queue3.submit([&](cl::sycl::handler& cgh) {
@@ -193,7 +193,7 @@ auto event_barrier2 = Queue2.submit([&](cl::sycl::handler& cgh) {
193193
// CG2
194194
});
195195
196-
Queue3.ext_oneapi_submit_barrier( vector_class<event>{event_barrier1, event_barrier2} );
196+
Queue3.ext_oneapi_submit_barrier( std::vector<event>{event_barrier1, event_barrier2} );
197197
198198
Queue3.submit([&](cl::sycl::handler& cgh) {
199199
// CG3
@@ -224,7 +224,7 @@ event submit(T cgf, const queue &secondaryQueue);
224224
225225
event ext_oneapi_submit_barrier();
226226
227-
event ext_oneapi_submit_barrier( const vector_class<event> &waitList );
227+
event ext_oneapi_submit_barrier( const std::vector<event> &waitList );
228228
229229
void wait();
230230
...
@@ -237,7 +237,7 @@ void wait();
237237
|========================================
238238
|*Member functions*|*Description*
239239
|`event ext_oneapi_submit_barrier()` | Same effect as submitting a `handler::ext_oneapi_barrier()` within a command group to this `queue`. The returned event enters the `info::event_command_status::complete` state when all events that the barrier is dependent on (implicitly from all previously submitted commands to the same queue) have entered the `info::event_command_status::complete` state.
240-
|`event ext_oneapi_submit_barrier( const vector_class<event> &waitList )` | Same effect as submitting a `handler:ext_oneapi_barrier( const vector_class<event> &waitList )` within a command group to this `queue`. The returned event enters the `info::event_command_status::complete` state when all events that the barrier is dependent on (explicitly from `waitList`) have entered the `info::event_command_status::complete` state.
240+
|`event ext_oneapi_submit_barrier( const std::vector<event> &waitList )` | Same effect as submitting a `handler:ext_oneapi_barrier( const std::vector<event> &waitList )` within a command group to this `queue`. The returned event enters the `info::event_command_status::complete` state when all events that the barrier is dependent on (explicitly from `waitList`) have entered the `info::event_command_status::complete` state.
241241
|========================================
242242

243243

@@ -275,7 +275,7 @@ void fill(void *ptr, const T &pattern, size_t count);
275275
276276
void ext_oneapi_barrier();
277277
278-
void ext_oneapi_barrier( const vector_class<event> &waitList );
278+
void ext_oneapi_barrier( const std::vector<event> &waitList );
279279
280280
};
281281
...
@@ -287,7 +287,7 @@ void ext_oneapi_barrier( const vector_class<event> &waitList );
287287

288288
Barriers may be submitted to a queue, with the effect that they prevent later operations submitted to the same queue from executing until the barrier wait conditions have been satisfied. The wait conditions can be explicitly described by `waitList` or implicitly from all previously submitted commands to the same queue. There are no constraints on the context from which queues may participate in the `waitList`. Enqueued barriers do not block host program execution, but instead form additional dependence edges with the execution task graph.
289289

290-
Barriers can be created by two members of the `handler` class that force synchronization on the SYCL command queue. The first variant of the `handler` barrier (`handler::barrier()`) takes no parameters, and waits for all previously submitted commands to the queue to enter the `info::event_command_status::complete` state before any command later submitted to the same queue is allowed to execute. The second variant of the `handler` barrier (`handler::barrier( const vector_class<event> &waitList )`) accepts a list of events, with the behavior that no commands submitted to the same queue after barrier submission may execute until all events in the waitList have entered the `info::event_command_status::complete` state.
290+
Barriers can be created by two members of the `handler` class that force synchronization on the SYCL command queue. The first variant of the `handler` barrier (`handler::barrier()`) takes no parameters, and waits for all previously submitted commands to the queue to enter the `info::event_command_status::complete` state before any command later submitted to the same queue is allowed to execute. The second variant of the `handler` barrier (`handler::barrier( const std::vector<event> &waitList )`) accepts a list of events, with the behavior that no commands submitted to the same queue after barrier submission may execute until all events in the waitList have entered the `info::event_command_status::complete` state.
291291

292292
=== Add a new table in the new section between 4.9.4 and 4.9.5: Member functions of the handler class.
293293

@@ -297,7 +297,7 @@ Barriers can be created by two members of the `handler` class that force synchro
297297
|========================================
298298
|*Member functions*|*Description*
299299
|`void ext_oneapi_barrier()` | Prevents any commands submitted afterward to this queue from executing until all commands previously submitted to this queue have entered the `info::event_command_status::complete` state.
300-
|`void ext_oneapi_barrier( const vector_class<event> &waitList` ) | Prevents any commands submitted afterward to this queue from executing until all events in `waitList` have entered the `info::event_command_status::complete` state. If `waitList` is empty, then the barrier has no effect.
300+
|`void ext_oneapi_barrier( const std::vector<event> &waitList` ) | Prevents any commands submitted afterward to this queue from executing until all events in `waitList` have entered the `info::event_command_status::complete` state. If `waitList` is empty, then the barrier has no effect.
301301
|========================================
302302

303303
== Issues

sycl/doc/extensions/LevelZeroBackend/LevelZeroBackend.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ a SYCL object that encapsulates a corresponding Level-Zero object:
8787
|-------------|:------------|
8888
|``` make<platform>(ze_driver_handle_t);```|Constructs a SYCL platform instance from a Level-Zero ```ze_driver_handle_t```.|
8989
|``` make<device>(const platform &, ze_device_handle_t);```|Constructs a SYCL device instance from a Level-Zero ```ze_device_handle_t```. The platform argument gives a SYCL platform, encapsulating a Level-Zero driver supporting the passed Level-Zero device.|
90-
|``` make<context>(const vector_class<device> &, ze_context_handle_t, ownership = transfer);```| Constructs a SYCL context instance from a Level-Zero ```ze_context_handle_t```. The context is created against the devices passed in. There must be at least one device given and all the devices must be from the same SYCL platform and thus from the same Level-Zero driver. The ```ownership``` argument specifies if the SYCL runtime should take ownership of the passed native handle. The default behavior is to transfer the ownership to the SYCL runtime. See section 4.4 for details.|
90+
|``` make<context>(const std::vector<device> &, ze_context_handle_t, ownership = transfer);```| Constructs a SYCL context instance from a Level-Zero ```ze_context_handle_t```. The context is created against the devices passed in. There must be at least one device given and all the devices must be from the same SYCL platform and thus from the same Level-Zero driver. The ```ownership``` argument specifies if the SYCL runtime should take ownership of the passed native handle. The default behavior is to transfer the ownership to the SYCL runtime. See section 4.4 for details.|
9191
|``` make<queue>(const context &, ze_command_queue_handle_t, ownership = transfer);```| Constructs a SYCL queue instance from a Level-Zero ```ze_command_queue_handle_t```. The context argument must be a valid SYCL context encapsulating a Level-Zero context. The queue is attached to the first device in the passed SYCL context. The ```ownership``` argument specifies if the SYCL runtime should take ownership of the passed native handle. The default behavior is to transfer the ownership to the SYCL runtime. See section 4.4 for details.|
9292
|``` make<event>(const context &, ze_event_handle_t, ownership = transfer);```| Constructs a SYCL event instance from a Level-Zero ```ze_event_handle_t```. The context argument must be a valid SYCL context encapsulating a Level-Zero context. The Level-Zero event should be allocated from an event pool created in the same context. The ```ownership``` argument specifies if the SYCL runtime should take ownership of the passed native handle. The default behavior is to transfer the ownership to the SYCL runtime. See section 4.4 for details.|
9393
|``` make<program>(const context &, ze_module_handle_t);```| Constructs a SYCL program instance from a Level-Zero ```ze_module_handle_t```. The context argument must be a valid SYCL context encapsulating a Level-Zero context. The Level-Zero module must be fully linked (i.e. not require further linking through [```zeModuleDynamicLink```](https://spec.oneapi.com/level-zero/latest/core/api.html?highlight=zemoduledynamiclink#_CPPv419zeModuleDynamicLink8uint32_tP18ze_module_handle_tP28ze_module_build_log_handle_t)), and thus the SYCL program is created in the "linked" state.|

sycl/doc/extensions/QueueShortcuts/queue.hpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ class queue {
88
event single_task(event DepEvent, KernelType KernelFunc); // (2)
99

1010
template <typename KernelName, typename KernelType>
11-
event single_task(const vector_class<event> &DepEvents,
12-
KernelType KernelFunc); // (3)
11+
event single_task(const std::vector<event> &DepEvents,
12+
KernelType KernelFunc); // (3)
1313

1414
template <typename KernelName, typename KernelType, int Dims>
1515
event parallel_for(range<Dims> NumWorkItems, KernelType KernelFunc); // (4)
@@ -20,8 +20,8 @@ class queue {
2020

2121
template <typename KernelName, typename KernelType, int Dims>
2222
event parallel_for(range<Dims> NumWorkItems,
23-
const vector_class<event> &DepEvents,
24-
KernelType KernelFunc); // (6)
23+
const std::vector<event> &DepEvents,
24+
KernelType KernelFunc); // (6)
2525

2626
template <typename KernelName, typename KernelType, int Dims>
2727
event parallel_for(range<Dims> NumWorkItems, id<Dims> WorkItemOffset,
@@ -33,8 +33,8 @@ class queue {
3333

3434
template <typename KernelName, typename KernelType, int Dims>
3535
event parallel_for(range<Dims> NumWorkItems, id<Dims> WorkItemOffset,
36-
const vector_class<event> &DepEvents,
37-
KernelType KernelFunc); // (9)
36+
const std::vector<event> &DepEvents,
37+
KernelType KernelFunc); // (9)
3838

3939
template <typename KernelName, typename KernelType, int Dims>
4040
event parallel_for(nd_range<Dims> ExecutionRange, KernelType KernelFunc); // (10)
@@ -45,6 +45,6 @@ class queue {
4545

4646
template <typename KernelName, typename KernelType, int Dims>
4747
event parallel_for(nd_range<Dims> ExecutionRange,
48-
const vector_class<event> &DepEvents,
49-
KernelType KernelFunc); // (12)
48+
const std::vector<event> &DepEvents,
49+
KernelType KernelFunc); // (12)
5050
};

sycl/doc/extensions/SubGroup/SYCL_INTEL_sub_group.asciidoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ The device descriptors below are added to the +info::device+ enumeration class:
108108
|Return a sub-group size supported by this device that is guaranteed to support all core language features for the device.
109109

110110
|+info::device::sub_group_sizes+
111-
|+vector_class<size_t>+
112-
|Returns a vector_class of +size_t+ containing the set of sub-group sizes supported by the device. Each sub-group size is a power of 2 in the range [1, 2^31^]. Not all sub-group sizes are guaranteed to be compatible with all core language features; any incompatibilities are implementation-defined.
111+
|+std::vector<size_t>+
112+
|Returns a std::vector of +size_t+ containing the set of sub-group sizes supported by the device. Each sub-group size is a power of 2 in the range [1, 2^31^]. Not all sub-group sizes are guaranteed to be compatible with all core language features; any incompatibilities are implementation-defined.
113113
|===
114114

115115
An additional query is added to the +kernel+ class, enabling an input value to be passed to `get_info`. The original `get_info` query from the SYCL_INTEL_device_specific_kernel_queries extension should be used for queries that do not specify an input type.

sycl/include/CL/sycl/exception.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class __SYCL_EXPORT exception : public std::exception {
7777
: MMsg(Msg + " " + detail::codeToString(CLErr)), MCLErr(CLErr),
7878
MContext(Context) {}
7979

80-
exception(const string_class &Msg) : MMsg(Msg), MContext(nullptr) {}
80+
exception(const std::string &Msg) : MMsg(Msg), MContext(nullptr) {}
8181

8282
// base constructor for all SYCL 2020 constructors
8383
// exception(context *ctxPtr, std::error_code ec, const std::string

sycl/include/CL/sycl/handler.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,7 @@ class __SYCL_EXPORT handler {
13991399
int Dims, typename Reduction>
14001400
void parallel_for(range<Dims> Range, Reduction Redu,
14011401
_KERNELFUNCPARAM(KernelFunc)) {
1402-
shared_ptr_class<detail::queue_impl> QueueCopy = MQueue;
1402+
std::shared_ptr<detail::queue_impl> QueueCopy = MQueue;
14031403

14041404
// Before running the kernels, check that device has enough local memory
14051405
// to hold local arrays required for the tree-reduction algorithm.
@@ -1485,7 +1485,7 @@ class __SYCL_EXPORT handler {
14851485
parallel_for(nd_range<Dims> Range, Reduction Redu,
14861486
_KERNELFUNCPARAM(KernelFunc)) {
14871487

1488-
shared_ptr_class<detail::queue_impl> QueueCopy = MQueue;
1488+
std::shared_ptr<detail::queue_impl> QueueCopy = MQueue;
14891489
device D = detail::getDeviceFromHandler(*this);
14901490

14911491
if (D.has(aspect::atomic64)) {

sycl/include/CL/sycl/queue.hpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ class __SYCL_EXPORT queue {
452452
/// \return an event representing fill operation.
453453
template <typename T>
454454
event fill(void *Ptr, const T &Pattern, size_t Count,
455-
const vector_class<event> &DepEvents) {
455+
const std::vector<event> &DepEvents) {
456456
return submit([&](handler &CGH) {
457457
CGH.depends_on(DepEvents);
458458
CGH.fill<T>(Ptr, Pattern, Count);
@@ -494,7 +494,7 @@ class __SYCL_EXPORT queue {
494494
/// dependencies.
495495
/// \return an event representing fill operation.
496496
event memset(void *Ptr, int Value, size_t Count,
497-
const vector_class<event> &DepEvents);
497+
const std::vector<event> &DepEvents);
498498

499499
/// Copies data from one memory region to another, both pointed by
500500
/// USM pointers.
@@ -534,7 +534,7 @@ class __SYCL_EXPORT queue {
534534
/// dependencies.
535535
/// \return an event representing copy operation.
536536
event memcpy(void *Dest, const void *Src, size_t Count,
537-
const vector_class<event> &DepEvents);
537+
const std::vector<event> &DepEvents);
538538

539539
/// Copies data from one memory region to another, both pointed by
540540
/// USM pointers.
@@ -579,7 +579,7 @@ class __SYCL_EXPORT queue {
579579
/// \return an event representing copy operation.
580580
template <typename T>
581581
event copy(const T *Src, T *Dest, size_t Count,
582-
const vector_class<event> &DepEvents) {
582+
const std::vector<event> &DepEvents) {
583583
return this->memcpy(Dest, Src, Count * sizeof(T), DepEvents);
584584
}
585585

@@ -622,7 +622,7 @@ class __SYCL_EXPORT queue {
622622
/// dependencies.
623623
/// \return an event representing advice operation.
624624
event mem_advise(const void *Ptr, size_t Length, int Advice,
625-
const vector_class<event> &DepEvents);
625+
const std::vector<event> &DepEvents);
626626

627627
/// Provides hints to the runtime library that data should be made available
628628
/// on a device earlier than Unified Shared Memory would normally require it
@@ -660,7 +660,7 @@ class __SYCL_EXPORT queue {
660660
/// dependencies.
661661
/// \return an event representing prefetch operation.
662662
event prefetch(const void *Ptr, size_t Count,
663-
const vector_class<event> &DepEvents) {
663+
const std::vector<event> &DepEvents) {
664664
return submit([=](handler &CGH) {
665665
CGH.depends_on(DepEvents);
666666
CGH.prefetch(Ptr, Count);
@@ -1066,7 +1066,7 @@ class __SYCL_EXPORT queue {
10661066
/// \param CodeLoc code location
10671067
///
10681068
/// This method stores additional information within event_impl class instance
1069-
event submit_impl_and_postprocess(function_class<void(handler &)> CGH,
1069+
event submit_impl_and_postprocess(std::function<void(handler &)> CGH,
10701070
const detail::code_location &CodeLoc,
10711071
const SubmitPostProcessF &PostProcess);
10721072
/// A template-free version of submit.
@@ -1075,7 +1075,7 @@ class __SYCL_EXPORT queue {
10751075
/// \param CodeLoc code location
10761076
///
10771077
/// This method stores additional information within event_impl class instance
1078-
event submit_impl_and_postprocess(function_class<void(handler &)> CGH,
1078+
event submit_impl_and_postprocess(std::function<void(handler &)> CGH,
10791079
queue secondQueue,
10801080
const detail::code_location &CodeLoc,
10811081
const SubmitPostProcessF &PostProcess);

sycl/include/CL/sycl/stl.hpp

-26
Original file line numberDiff line numberDiff line change
@@ -47,32 +47,6 @@ namespace sycl {
4747
#endif
4848
#endif // defined(_WIN32) && !defined(_DLL) && !defined(__SYCL_DEVICE_ONLY__)
4949

50-
// TODO deprecation attribute can not be applied to template alias. Find a way
51-
// to show deprecation warning with those aliases anyway.
52-
53-
template <class T, class Alloc = std::allocator<T>>
54-
using vector_class = std::vector<T, Alloc>;
55-
56-
using string_class
57-
__SYCL2020_DEPRECATED("use STL classes directly") = std::string;
58-
59-
template <class Sig> using function_class = std::function<Sig>;
60-
61-
using mutex_class
62-
__SYCL2020_DEPRECATED("use STL classes directly") = std::mutex;
63-
64-
template <class T, class Deleter = std::default_delete<T>>
65-
using unique_ptr_class = std::unique_ptr<T, Deleter>;
66-
67-
template <class T> using shared_ptr_class = std::shared_ptr<T>;
68-
69-
template <class T> using weak_ptr_class = std::weak_ptr<T>;
70-
71-
template <class T> using hash_class = std::hash<T>;
72-
73-
using exception_ptr_class
74-
__SYCL2020_DEPRECATED("use STL classes directly") = std::exception_ptr;
75-
7650
template <typename T, typename... ArgsT>
7751
std::unique_ptr<T> make_unique_ptr(ArgsT &&... Args) {
7852
return std::unique_ptr<T>(new T(std::forward<ArgsT>(Args)...));

sycl/include/sycl/ext/oneapi/reduction.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2073,7 +2073,7 @@ namespace __SYCL2020_DEPRECATED("use 'ext::oneapi' instead") ONEAPI {
20732073
using namespace ext::oneapi;
20742074
namespace detail {
20752075
using cl::sycl::detail::queue_impl;
2076-
__SYCL_EXPORT size_t reduGetMaxWGSize(shared_ptr_class<queue_impl> Queue,
2076+
__SYCL_EXPORT size_t reduGetMaxWGSize(std::shared_ptr<queue_impl> Queue,
20772077
size_t LocalMemBytesPerWorkItem);
20782078
__SYCL_EXPORT size_t reduComputeWGSize(size_t NWorkItems, size_t MaxWGSize,
20792079
size_t &NWorkGroups);

0 commit comments

Comments
 (0)