Skip to content

[SYCL] Deprecate some SYCL 1.2.1 APIs in SYCL2020 mode #3954

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 6 commits into from
Jun 29, 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
2 changes: 1 addition & 1 deletion sycl/include/CL/sycl/INTEL/online_compiler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class device_arch {
class online_compile_error : public sycl::exception {
public:
online_compile_error() = default;
online_compile_error(const string_class &Msg) : sycl::exception(Msg) {}
online_compile_error(const std::string &Msg) : sycl::exception(Msg) {}
};

/// Designates a source language for the online compiler.
Expand Down
23 changes: 12 additions & 11 deletions sycl/include/CL/sycl/ONEAPI/reduction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ template <typename... Ts> ReduTupleT<Ts...> makeReduTupleT(Ts... Elements) {
return sycl::detail::make_tuple(Elements...);
}

__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 Expand Up @@ -698,10 +698,10 @@ class reduction_impl : private reduction_impl_base {
const T MIdentity;

/// User's accessor to where the reduction must be written.
shared_ptr_class<rw_accessor_type> MRWAcc;
shared_ptr_class<dw_accessor_type> MDWAcc;
std::shared_ptr<rw_accessor_type> MRWAcc;
std::shared_ptr<dw_accessor_type> MDWAcc;

shared_ptr_class<buffer<T, buffer_dim>> MOutBufPtr;
std::shared_ptr<buffer<T, buffer_dim>> MOutBufPtr;

/// USM pointer referencing the memory to where the result of the reduction
/// must be written. Applicable/used only for USM reductions.
Expand Down Expand Up @@ -1584,13 +1584,14 @@ size_t reduAuxCGFunc(handler &CGH, size_t NWorkItems, size_t MaxWGSize,
return NWorkGroups;
}

inline void reduSaveFinalResultToUserMemHelper(
std::vector<event> &, shared_ptr_class<detail::queue_impl>, bool) {}
inline void
reduSaveFinalResultToUserMemHelper(std::vector<event> &,
std::shared_ptr<detail::queue_impl>, bool) {}

template <typename Reduction, typename... RestT>
std::enable_if_t<Reduction::is_usm>
reduSaveFinalResultToUserMemHelper(std::vector<event> &Events,
shared_ptr_class<detail::queue_impl> Queue,
std::shared_ptr<detail::queue_impl> Queue,
bool IsHost, Reduction &, RestT... Rest) {
// Reductions initialized with USM pointer currently do not require copying
// because the last kernel write directly to USM memory.
Expand All @@ -1599,7 +1600,7 @@ reduSaveFinalResultToUserMemHelper(std::vector<event> &Events,

template <typename Reduction, typename... RestT>
std::enable_if_t<!Reduction::is_usm> reduSaveFinalResultToUserMemHelper(
std::vector<event> &Events, shared_ptr_class<detail::queue_impl> Queue,
std::vector<event> &Events, std::shared_ptr<detail::queue_impl> Queue,
bool IsHost, Reduction &Redu, RestT... Rest) {
if (Redu.hasUserDiscardWriteAccessor()) {
handler CopyHandler(Queue, IsHost);
Expand All @@ -1620,16 +1621,16 @@ std::enable_if_t<!Reduction::is_usm> reduSaveFinalResultToUserMemHelper(
/// Returns the event to the last kernel copying data or nullptr if no
/// additional kernels created.
template <typename... Reduction, size_t... Is>
shared_ptr_class<event>
reduSaveFinalResultToUserMem(shared_ptr_class<detail::queue_impl> Queue,
std::shared_ptr<event>
reduSaveFinalResultToUserMem(std::shared_ptr<detail::queue_impl> Queue,
bool IsHost, std::tuple<Reduction...> &ReduTuple,
std::index_sequence<Is...>) {
std::vector<event> Events;
reduSaveFinalResultToUserMemHelper(Events, Queue, IsHost,
std::get<Is>(ReduTuple)...);
if (!Events.empty())
return std::make_shared<event>(Events.back());
return shared_ptr_class<event>();
return std::shared_ptr<event>();
}

template <typename Reduction> size_t reduGetMemPerWorkItemHelper(Reduction &) {
Expand Down
2 changes: 1 addition & 1 deletion sycl/include/CL/sycl/aliases.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ using half = cl::sycl::detail::half_impl::half;

__SYCL_INLINE_NAMESPACE(cl) {
namespace sycl {
using byte = std::uint8_t;
using byte __SYCL2020_DEPRECATED("use std::byte instead") = std::uint8_t;
using schar = signed char;
using uchar = unsigned char;
using ushort = unsigned short;
Expand Down
4 changes: 2 additions & 2 deletions sycl/include/CL/sycl/backend/level_zero.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ enum class ownership { transfer, keep };
__SYCL_EXPORT platform make_platform(pi_native_handle NativeHandle);
__SYCL_EXPORT device make_device(const platform &Platform,
pi_native_handle NativeHandle);
__SYCL_EXPORT context make_context(const vector_class<device> &DeviceList,
__SYCL_EXPORT context make_context(const std::vector<device> &DeviceList,
pi_native_handle NativeHandle,
bool keep_ownership = false);
__SYCL_EXPORT program make_program(const context &Context,
Expand Down Expand Up @@ -120,7 +120,7 @@ T make(const platform &Platform,
///
template <typename T, typename std::enable_if<
std::is_same<T, context>::value>::type * = nullptr>
T make(const vector_class<device> &DeviceList,
T make(const std::vector<device> &DeviceList,
typename interop<backend::level_zero, T>::type Interop,
ownership Ownership = ownership::transfer) {
return make_context(DeviceList, detail::pi::cast<pi_native_handle>(Interop),
Expand Down
12 changes: 6 additions & 6 deletions sycl/include/CL/sycl/buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class buffer {
allocator));
}

buffer(const shared_ptr_class<T> &hostData,
buffer(const std::shared_ptr<T> &hostData,
const range<dimensions> &bufferRange, AllocatorT allocator,
const property_list &propList = {})
: Range(bufferRange) {
Expand All @@ -129,7 +129,7 @@ class buffer {
allocator));
}

buffer(const shared_ptr_class<T[]> &hostData,
buffer(const std::shared_ptr<T[]> &hostData,
const range<dimensions> &bufferRange, AllocatorT allocator,
const property_list &propList = {})
: Range(bufferRange) {
Expand All @@ -140,7 +140,7 @@ class buffer {
allocator));
}

buffer(const shared_ptr_class<T> &hostData,
buffer(const std::shared_ptr<T> &hostData,
const range<dimensions> &bufferRange,
const property_list &propList = {})
: Range(bufferRange) {
Expand All @@ -150,7 +150,7 @@ class buffer {
make_unique_ptr<detail::SYCLMemObjAllocatorHolder<AllocatorT>>());
}

buffer(const shared_ptr_class<T[]> &hostData,
buffer(const std::shared_ptr<T[]> &hostData,
const range<dimensions> &bufferRange,
const property_list &propList = {})
: Range(bufferRange) {
Expand Down Expand Up @@ -389,7 +389,7 @@ class buffer {
}

private:
shared_ptr_class<detail::buffer_impl> impl;
std::shared_ptr<detail::buffer_impl> impl;
template <class Obj>
friend decltype(Obj::impl) detail::getSyclObjImpl(const Obj &SyclObject);
template <typename A, int dims, typename C, typename Enable>
Expand All @@ -404,7 +404,7 @@ class buffer {
bool IsSubBuffer = false;

// Reinterpret contructor
buffer(shared_ptr_class<detail::buffer_impl> Impl,
buffer(std::shared_ptr<detail::buffer_impl> Impl,
range<dimensions> reinterpretRange, size_t reinterpretOffset,
bool isSubBuffer)
: impl(Impl), Range(reinterpretRange), OffsetInBytes(reinterpretOffset),
Expand Down
12 changes: 6 additions & 6 deletions sycl/include/CL/sycl/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class __SYCL_EXPORT context {
///
/// \param DeviceList is a list of SYCL device instances.
/// \param PropList is an instance of property_list.
explicit context(const vector_class<device> &DeviceList,
explicit context(const std::vector<device> &DeviceList,
const property_list &PropList = {});

/// Constructs a SYCL context instance using list of devices.
Expand All @@ -136,7 +136,7 @@ class __SYCL_EXPORT context {
/// \param DeviceList is a list of SYCL device instances.
/// \param AsyncHandler is an instance of async_handler.
/// \param PropList is an instance of property_list.
explicit context(const vector_class<device> &DeviceList,
explicit context(const std::vector<device> &DeviceList,
async_handler AsyncHandler,
const property_list &PropList = {});

Expand Down Expand Up @@ -209,7 +209,7 @@ class __SYCL_EXPORT context {
/// Gets devices associated with this SYCL context.
///
/// \return a vector of valid SYCL device instances.
vector_class<device> get_devices() const;
std::vector<device> get_devices() const;

/// Gets the native handle of the SYCL context.
///
Expand All @@ -222,11 +222,11 @@ class __SYCL_EXPORT context {

private:
/// Constructs a SYCL context object from a valid context_impl instance.
context(shared_ptr_class<detail::context_impl> Impl);
context(std::shared_ptr<detail::context_impl> Impl);

pi_native_handle getNative() const;

shared_ptr_class<detail::context_impl> impl;
std::shared_ptr<detail::context_impl> impl;
template <class Obj>
friend decltype(Obj::impl) detail::getSyclObjImpl(const Obj &SyclObject);

Expand All @@ -245,7 +245,7 @@ class __SYCL_EXPORT context {
namespace std {
template <> struct hash<cl::sycl::context> {
size_t operator()(const cl::sycl::context &Context) const {
return hash<cl::sycl::shared_ptr_class<cl::sycl::detail::context_impl>>()(
return hash<std::shared_ptr<cl::sycl::detail::context_impl>>()(
cl::sycl::detail::getSyclObjImpl(Context));
}
};
Expand Down
10 changes: 5 additions & 5 deletions sycl/include/CL/sycl/detail/accessor_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ class __SYCL_EXPORT AccessorImplHost {
bool MIsESIMDAcc;
};

using AccessorImplPtr = shared_ptr_class<AccessorImplHost>;
using AccessorImplPtr = std::shared_ptr<AccessorImplHost>;

class AccessorBaseHost {
public:
AccessorBaseHost(id<3> Offset, range<3> AccessRange, range<3> MemoryRange,
access::mode AccessMode, detail::SYCLMemObjI *SYCLMemObject,
int Dims, int ElemSize, int OffsetInBytes = 0,
bool IsSubBuffer = false) {
impl = shared_ptr_class<AccessorImplHost>(new AccessorImplHost(
impl = std::shared_ptr<AccessorImplHost>(new AccessorImplHost(
Offset, AccessRange, MemoryRange, AccessMode, SYCLMemObject, Dims,
ElemSize, OffsetInBytes, IsSubBuffer));
}
Expand Down Expand Up @@ -180,12 +180,12 @@ class __SYCL_EXPORT LocalAccessorImplHost {
std::vector<char> MMem;
};

using LocalAccessorImplPtr = shared_ptr_class<LocalAccessorImplHost>;
using LocalAccessorImplPtr = std::shared_ptr<LocalAccessorImplHost>;

class LocalAccessorBaseHost {
public:
LocalAccessorBaseHost(sycl::range<3> Size, int Dims, int ElemSize) {
impl = shared_ptr_class<LocalAccessorImplHost>(
impl = std::shared_ptr<LocalAccessorImplHost>(
new LocalAccessorImplHost(Size, Dims, ElemSize));
}
sycl::range<3> &getSize() { return impl->MSize; }
Expand All @@ -202,7 +202,7 @@ class LocalAccessorBaseHost {
template <class Obj>
friend decltype(Obj::impl) getSyclObjImpl(const Obj &SyclObject);

shared_ptr_class<LocalAccessorImplHost> impl;
std::shared_ptr<LocalAccessorImplHost> impl;
};

using Requirement = AccessorImplHost;
Expand Down
16 changes: 8 additions & 8 deletions sycl/include/CL/sycl/detail/buffer_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class __SYCL_EXPORT buffer_impl final : public SYCLMemObjT {

public:
buffer_impl(size_t SizeInBytes, size_t, const property_list &Props,
unique_ptr_class<SYCLMemObjAllocator> Allocator)
std::unique_ptr<SYCLMemObjAllocator> Allocator)
: BaseT(SizeInBytes, Props, std::move(Allocator)) {

if (Props.has_property<sycl::property::buffer::use_host_ptr>())
Expand All @@ -56,7 +56,7 @@ class __SYCL_EXPORT buffer_impl final : public SYCLMemObjT {

buffer_impl(void *HostData, size_t SizeInBytes, size_t RequiredAlign,
const property_list &Props,
unique_ptr_class<SYCLMemObjAllocator> Allocator)
std::unique_ptr<SYCLMemObjAllocator> Allocator)
: BaseT(SizeInBytes, Props, std::move(Allocator)) {

if (Props.has_property<
Expand All @@ -70,7 +70,7 @@ class __SYCL_EXPORT buffer_impl final : public SYCLMemObjT {

buffer_impl(const void *HostData, size_t SizeInBytes, size_t RequiredAlign,
const property_list &Props,
unique_ptr_class<SYCLMemObjAllocator> Allocator)
std::unique_ptr<SYCLMemObjAllocator> Allocator)
: BaseT(SizeInBytes, Props, std::move(Allocator)) {

if (Props.has_property<
Expand All @@ -83,9 +83,9 @@ class __SYCL_EXPORT buffer_impl final : public SYCLMemObjT {
}

template <typename T>
buffer_impl(const shared_ptr_class<T> &HostData, const size_t SizeInBytes,
buffer_impl(const std::shared_ptr<T> &HostData, const size_t SizeInBytes,
size_t RequiredAlign, const property_list &Props,
unique_ptr_class<SYCLMemObjAllocator> Allocator)
std::unique_ptr<SYCLMemObjAllocator> Allocator)
: BaseT(SizeInBytes, Props, std::move(Allocator)) {

if (Props.has_property<
Expand All @@ -105,7 +105,7 @@ class __SYCL_EXPORT buffer_impl final : public SYCLMemObjT {
buffer_impl(EnableIfNotConstIterator<InputIterator> First, InputIterator Last,
const size_t SizeInBytes, size_t RequiredAlign,
const property_list &Props,
unique_ptr_class<SYCLMemObjAllocator> Allocator)
std::unique_ptr<SYCLMemObjAllocator> Allocator)
: BaseT(SizeInBytes, Props, std::move(Allocator)) {

if (Props.has_property<sycl::property::buffer::use_host_ptr>())
Expand All @@ -125,7 +125,7 @@ class __SYCL_EXPORT buffer_impl final : public SYCLMemObjT {
buffer_impl(EnableIfConstIterator<InputIterator> First, InputIterator Last,
const size_t SizeInBytes, size_t RequiredAlign,
const property_list &Props,
unique_ptr_class<SYCLMemObjAllocator> Allocator)
std::unique_ptr<SYCLMemObjAllocator> Allocator)
: BaseT(SizeInBytes, Props, std::move(Allocator)) {

if (Props.has_property<sycl::property::buffer::use_host_ptr>())
Expand All @@ -139,7 +139,7 @@ class __SYCL_EXPORT buffer_impl final : public SYCLMemObjT {

buffer_impl(cl_mem MemObject, const context &SyclContext,
const size_t SizeInBytes,
unique_ptr_class<SYCLMemObjAllocator> Allocator,
std::unique_ptr<SYCLMemObjAllocator> Allocator,
event AvailableEvent)
: BaseT(MemObject, SyclContext, SizeInBytes, std::move(AvailableEvent),
std::move(Allocator)) {}
Expand Down
Loading