Skip to content

[SYCL] Remove _class aliases #4465

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 2 commits into from
Sep 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions sycl/doc/extensions/EnqueueBarrier/enqueue_barrier.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ two new members to the `queue` class:
|========================================
|*handler::ext_oneapi_barrier*|*queue::ext_oneapi_submit_barrier*
|`void ext_oneapi_barrier()` | `event ext_oneapi_submit_barrier()`
|`void ext_oneapi_barrier( const vector_class<event> &waitList )` | `event ext_oneapi_submit_barrier( const vector_class<event> &waitList )`
|`void ext_oneapi_barrier( const std::vector<event> &waitList )` | `event ext_oneapi_submit_barrier( const std::vector<event> &waitList )`
|========================================

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.
Expand Down Expand Up @@ -171,7 +171,7 @@ auto event_barrier2 = Queue2.submit([&](cl::sycl::handler& cgh) {
});

Queue3.submit([&](cl::sycl::handler& cgh) {
cgh.ext_oneapi_barrier( vector_class<event>{event_barrier1, event_barrier2} );
cgh.ext_oneapi_barrier( std::vector<event>{event_barrier1, event_barrier2} );
});

Queue3.submit([&](cl::sycl::handler& cgh) {
Expand All @@ -193,7 +193,7 @@ auto event_barrier2 = Queue2.submit([&](cl::sycl::handler& cgh) {
// CG2
});

Queue3.ext_oneapi_submit_barrier( vector_class<event>{event_barrier1, event_barrier2} );
Queue3.ext_oneapi_submit_barrier( std::vector<event>{event_barrier1, event_barrier2} );

Queue3.submit([&](cl::sycl::handler& cgh) {
// CG3
Expand Down Expand Up @@ -224,7 +224,7 @@ event submit(T cgf, const queue &secondaryQueue);

event ext_oneapi_submit_barrier();

event ext_oneapi_submit_barrier( const vector_class<event> &waitList );
event ext_oneapi_submit_barrier( const std::vector<event> &waitList );

void wait();
...
Expand All @@ -237,7 +237,7 @@ void wait();
|========================================
|*Member functions*|*Description*
|`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.
|`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.
|`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.
|========================================


Expand Down Expand Up @@ -275,7 +275,7 @@ void fill(void *ptr, const T &pattern, size_t count);

void ext_oneapi_barrier();

void ext_oneapi_barrier( const vector_class<event> &waitList );
void ext_oneapi_barrier( const std::vector<event> &waitList );

};
...
Expand All @@ -287,7 +287,7 @@ void ext_oneapi_barrier( const vector_class<event> &waitList );

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.

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.
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.

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

Expand All @@ -297,7 +297,7 @@ Barriers can be created by two members of the `handler` class that force synchro
|========================================
|*Member functions*|*Description*
|`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.
|`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.
|`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.
|========================================

== Issues
Expand Down
2 changes: 1 addition & 1 deletion sycl/doc/extensions/LevelZeroBackend/LevelZeroBackend.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ a SYCL object that encapsulates a corresponding Level-Zero object:
|-------------|:------------|
|``` make<platform>(ze_driver_handle_t);```|Constructs a SYCL platform instance from a Level-Zero ```ze_driver_handle_t```.|
|``` 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.|
|``` 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.|
|``` 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.|
|``` 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.|
|``` 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.|
|``` 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.|
Expand Down
16 changes: 8 additions & 8 deletions sycl/doc/extensions/QueueShortcuts/queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class queue {
event single_task(event DepEvent, KernelType KernelFunc); // (2)

template <typename KernelName, typename KernelType>
event single_task(const vector_class<event> &DepEvents,
KernelType KernelFunc); // (3)
event single_task(const std::vector<event> &DepEvents,
KernelType KernelFunc); // (3)

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

template <typename KernelName, typename KernelType, int Dims>
event parallel_for(range<Dims> NumWorkItems,
const vector_class<event> &DepEvents,
KernelType KernelFunc); // (6)
const std::vector<event> &DepEvents,
KernelType KernelFunc); // (6)

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

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

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

template <typename KernelName, typename KernelType, int Dims>
event parallel_for(nd_range<Dims> ExecutionRange,
const vector_class<event> &DepEvents,
KernelType KernelFunc); // (12)
const std::vector<event> &DepEvents,
KernelType KernelFunc); // (12)
};
4 changes: 2 additions & 2 deletions sycl/doc/extensions/SubGroup/SYCL_INTEL_sub_group.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ The device descriptors below are added to the +info::device+ enumeration class:
|Return a sub-group size supported by this device that is guaranteed to support all core language features for the device.

|+info::device::sub_group_sizes+
|+vector_class<size_t>+
|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.
|+std::vector<size_t>+
|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.
|===

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.
Expand Down
2 changes: 1 addition & 1 deletion sycl/include/CL/sycl/exception.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class __SYCL_EXPORT exception : public std::exception {
: MMsg(Msg + " " + detail::codeToString(CLErr)), MCLErr(CLErr),
MContext(Context) {}

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

// base constructor for all SYCL 2020 constructors
// exception(context *ctxPtr, std::error_code ec, const std::string
Expand Down
4 changes: 2 additions & 2 deletions sycl/include/CL/sycl/handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1375,7 +1375,7 @@ class __SYCL_EXPORT handler {
int Dims, typename Reduction>
void parallel_for(range<Dims> Range, Reduction Redu,
_KERNELFUNCPARAM(KernelFunc)) {
shared_ptr_class<detail::queue_impl> QueueCopy = MQueue;
std::shared_ptr<detail::queue_impl> QueueCopy = MQueue;

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

shared_ptr_class<detail::queue_impl> QueueCopy = MQueue;
std::shared_ptr<detail::queue_impl> QueueCopy = MQueue;
device D = detail::getDeviceFromHandler(*this);

if (D.has(aspect::atomic64)) {
Expand Down
16 changes: 8 additions & 8 deletions sycl/include/CL/sycl/queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ class __SYCL_EXPORT queue {
/// \return an event representing fill operation.
template <typename T>
event fill(void *Ptr, const T &Pattern, size_t Count,
const vector_class<event> &DepEvents) {
const std::vector<event> &DepEvents) {
return submit([&](handler &CGH) {
CGH.depends_on(DepEvents);
CGH.fill<T>(Ptr, Pattern, Count);
Expand Down Expand Up @@ -490,7 +490,7 @@ class __SYCL_EXPORT queue {
/// dependencies.
/// \return an event representing fill operation.
event memset(void *Ptr, int Value, size_t Count,
const vector_class<event> &DepEvents);
const std::vector<event> &DepEvents);

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

/// Copies data from one memory region to another, both pointed by
/// USM pointers.
Expand Down Expand Up @@ -575,7 +575,7 @@ class __SYCL_EXPORT queue {
/// \return an event representing copy operation.
template <typename T>
event copy(const T *Src, T *Dest, size_t Count,
const vector_class<event> &DepEvents) {
const std::vector<event> &DepEvents) {
return this->memcpy(Dest, Src, Count * sizeof(T), DepEvents);
}

Expand Down Expand Up @@ -618,7 +618,7 @@ class __SYCL_EXPORT queue {
/// dependencies.
/// \return an event representing advice operation.
event mem_advise(const void *Ptr, size_t Length, int Advice,
const vector_class<event> &DepEvents);
const std::vector<event> &DepEvents);

/// Provides hints to the runtime library that data should be made available
/// on a device earlier than Unified Shared Memory would normally require it
Expand Down Expand Up @@ -656,7 +656,7 @@ class __SYCL_EXPORT queue {
/// dependencies.
/// \return an event representing prefetch operation.
event prefetch(const void *Ptr, size_t Count,
const vector_class<event> &DepEvents) {
const std::vector<event> &DepEvents) {
return submit([=](handler &CGH) {
CGH.depends_on(DepEvents);
CGH.prefetch(Ptr, Count);
Expand Down Expand Up @@ -1061,7 +1061,7 @@ class __SYCL_EXPORT queue {
/// \param CodeLoc code location
///
/// This method stores additional information within event_impl class instance
event submit_impl_and_postprocess(function_class<void(handler &)> CGH,
event submit_impl_and_postprocess(std::function<void(handler &)> CGH,
const detail::code_location &CodeLoc,
const SubmitPostProcessF &PostProcess);
/// A template-free version of submit.
Expand All @@ -1070,7 +1070,7 @@ class __SYCL_EXPORT queue {
/// \param CodeLoc code location
///
/// This method stores additional information within event_impl class instance
event submit_impl_and_postprocess(function_class<void(handler &)> CGH,
event submit_impl_and_postprocess(std::function<void(handler &)> CGH,
queue secondQueue,
const detail::code_location &CodeLoc,
const SubmitPostProcessF &PostProcess);
Expand Down
26 changes: 0 additions & 26 deletions sycl/include/CL/sycl/stl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,32 +47,6 @@ namespace sycl {
#endif
#endif // defined(_WIN32) && !defined(_DLL) && !defined(__SYCL_DEVICE_ONLY__)

// TODO deprecation attribute can not be applied to template alias. Find a way
// to show deprecation warning with those aliases anyway.

template <class T, class Alloc = std::allocator<T>>
using vector_class = std::vector<T, Alloc>;

using string_class
__SYCL2020_DEPRECATED("use STL classes directly") = std::string;

template <class Sig> using function_class = std::function<Sig>;

using mutex_class
__SYCL2020_DEPRECATED("use STL classes directly") = std::mutex;

template <class T, class Deleter = std::default_delete<T>>
using unique_ptr_class = std::unique_ptr<T, Deleter>;

template <class T> using shared_ptr_class = std::shared_ptr<T>;

template <class T> using weak_ptr_class = std::weak_ptr<T>;

template <class T> using hash_class = std::hash<T>;

using exception_ptr_class
__SYCL2020_DEPRECATED("use STL classes directly") = std::exception_ptr;

template <typename T, typename... ArgsT>
std::unique_ptr<T> make_unique_ptr(ArgsT &&... Args) {
return std::unique_ptr<T>(new T(std::forward<ArgsT>(Args)...));
Expand Down
2 changes: 1 addition & 1 deletion sycl/include/sycl/ext/oneapi/reduction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2073,7 +2073,7 @@ namespace __SYCL2020_DEPRECATED("use 'ext::oneapi' instead") ONEAPI {
using namespace ext::oneapi;
namespace detail {
using cl::sycl::detail::queue_impl;
__SYCL_EXPORT size_t reduGetMaxWGSize(shared_ptr_class<queue_impl> Queue,
__SYCL_EXPORT size_t reduGetMaxWGSize(std::shared_ptr<queue_impl> Queue,
size_t LocalMemBytesPerWorkItem);
__SYCL_EXPORT size_t reduComputeWGSize(size_t NWorkItems, size_t MaxWGSize,
size_t &NWorkGroups);
Expand Down
Loading