From bbafe08fd49081922b84e942c2cac2566fce697c Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Fri, 8 Oct 2021 17:11:15 +0300 Subject: [PATCH] [SYCL] Remove SYCL 1.2.1-style OpenCL interop APIs (#4480) --- sycl/include/CL/sycl/backend.hpp | 5 +-- sycl/include/CL/sycl/buffer.hpp | 36 ++++++++++++++++--- sycl/include/CL/sycl/context.hpp | 6 ++-- sycl/include/CL/sycl/detail/buffer_impl.hpp | 9 +++++ .../include/CL/sycl/detail/sycl_mem_obj_t.hpp | 10 ++++++ sycl/include/CL/sycl/device.hpp | 6 ++-- sycl/include/CL/sycl/event.hpp | 6 ++-- sycl/include/CL/sycl/image.hpp | 3 +- sycl/include/CL/sycl/kernel.hpp | 8 ++--- sycl/include/CL/sycl/platform.hpp | 6 ++-- sycl/include/CL/sycl/queue.hpp | 6 ++-- sycl/include/CL/sycl/sampler.hpp | 3 +- sycl/source/detail/sycl_mem_obj_t.cpp | 13 ++++++- sycl/test/abi/sycl_symbols_linux.dump | 3 ++ sycl/test/abi/sycl_symbols_windows.dump | 3 ++ sycl/test/basic_tests/context.cpp | 6 ---- sycl/test/basic_tests/device.cpp | 6 ---- sycl/test/warnings/sycl_2020_deprecations.cpp | 30 ++++++++-------- .../scheduler/NoHostUnifiedMemory.cpp | 3 +- 19 files changed, 117 insertions(+), 51 deletions(-) diff --git a/sycl/include/CL/sycl/backend.hpp b/sycl/include/CL/sycl/backend.hpp index ce5ecbbd8c8b6..1009a2b49166a 100644 --- a/sycl/include/CL/sycl/backend.hpp +++ b/sycl/include/CL/sycl/backend.hpp @@ -207,8 +207,9 @@ typename std::enable_if::MakeBuffer == make_buffer(const typename backend_traits::template input_type< buffer> &BackendObject, const context &TargetContext, event AvailableEvent = {}) { - return buffer( - reinterpret_cast(BackendObject), TargetContext, AvailableEvent); + return detail::make_buffer_helper( + detail::pi::cast(BackendObject), TargetContext, + AvailableEvent); } template diff --git a/sycl/include/CL/sycl/buffer.hpp b/sycl/include/CL/sycl/buffer.hpp index eee3df0d94eac..7f0c86ae49ef6 100755 --- a/sycl/include/CL/sycl/buffer.hpp +++ b/sycl/include/CL/sycl/buffer.hpp @@ -23,6 +23,14 @@ class handler; class queue; template class range; +namespace detail { +template +buffer +make_buffer_helper(pi_native_handle Handle, const context &Ctx, event Evt) { + return buffer(Handle, Ctx, Evt); +} +} // namespace detail + /// Defines a shared array that can be used by kernels in queues. /// /// Buffers can be 1-, 2-, and 3-dimensional. They have to be accessed using @@ -33,8 +41,8 @@ template class range; /// \ingroup sycl_api template 0) && - (dimensions <= 3)>> + typename __Enabled = typename detail::enable_if_t<(dimensions > 0) && + (dimensions <= 3)>> class buffer { public: using value_type = T; @@ -223,8 +231,8 @@ class buffer { "Requested sub-buffer region is not contiguous", PI_INVALID_VALUE); } +#ifdef __SYCL_INTERNAL_API template > - __SYCL2020_DEPRECATED("OpenCL interop APIs are deprecated") buffer(cl_mem MemObject, const context &SyclContext, event AvailableEvent = {}) : Range{0} { @@ -234,10 +242,11 @@ class buffer { Range[0] = BufSize / sizeof(T); impl = std::make_shared( - MemObject, SyclContext, BufSize, + detail::pi::cast(MemObject), SyclContext, BufSize, make_unique_ptr>(), AvailableEvent); } +#endif buffer(const buffer &rhs) = default; @@ -398,12 +407,31 @@ class buffer { template friend class accessor; + template + friend buffer + detail::make_buffer_helper(pi_native_handle, const context &, event); range Range; // Offset field specifies the origin of the sub buffer inside the parent // buffer size_t OffsetInBytes = 0; bool IsSubBuffer = false; + // Interop constructor + template > + buffer(pi_native_handle MemObject, const context &SyclContext, + event AvailableEvent = {}) + : Range{0} { + + size_t BufSize = detail::SYCLMemObjT::getBufSizeForContext( + detail::getSyclObjImpl(SyclContext), MemObject); + + Range[0] = BufSize / sizeof(T); + impl = std::make_shared( + MemObject, SyclContext, BufSize, + make_unique_ptr>(), + AvailableEvent); + } + // Reinterpret contructor buffer(std::shared_ptr Impl, range reinterpretRange, size_t reinterpretOffset, diff --git a/sycl/include/CL/sycl/context.hpp b/sycl/include/CL/sycl/context.hpp index 7fd2e1f343580..20b3978f5a8e5 100644 --- a/sycl/include/CL/sycl/context.hpp +++ b/sycl/include/CL/sycl/context.hpp @@ -149,8 +149,9 @@ class __SYCL_EXPORT context { /// /// \param ClContext is an instance of OpenCL cl_context. /// \param AsyncHandler is an instance of async_handler. - __SYCL2020_DEPRECATED("OpenCL interop APIs are deprecated") +#ifdef __SYCL_INTERNAL_API context(cl_context ClContext, async_handler AsyncHandler = {}); +#endif /// Queries this SYCL context for information. /// @@ -189,8 +190,9 @@ class __SYCL_EXPORT context { /// The OpenCL cl_context handle is retained on return. /// /// \return a valid instance of OpenCL cl_context. - __SYCL2020_DEPRECATED("OpenCL interop APIs are deprecated") +#ifdef __SYCL_INTERNAL_API cl_context get() const; +#endif /// Checks if this context is a SYCL host context. /// diff --git a/sycl/include/CL/sycl/detail/buffer_impl.hpp b/sycl/include/CL/sycl/detail/buffer_impl.hpp index 3d5021427254d..7de8dc84d1361 100644 --- a/sycl/include/CL/sycl/detail/buffer_impl.hpp +++ b/sycl/include/CL/sycl/detail/buffer_impl.hpp @@ -8,6 +8,7 @@ #pragma once +#include "CL/sycl/detail/pi.h" #include #include #include @@ -141,6 +142,14 @@ class __SYCL_EXPORT buffer_impl final : public SYCLMemObjT { const size_t SizeInBytes, std::unique_ptr Allocator, event AvailableEvent) + : buffer_impl(pi::cast(MemObject), SyclContext, + SizeInBytes, std::move(Allocator), + std::move(AvailableEvent)) {} + + buffer_impl(pi_native_handle MemObject, const context &SyclContext, + const size_t SizeInBytes, + std::unique_ptr Allocator, + event AvailableEvent) : BaseT(MemObject, SyclContext, SizeInBytes, std::move(AvailableEvent), std::move(Allocator)) {} diff --git a/sycl/include/CL/sycl/detail/sycl_mem_obj_t.hpp b/sycl/include/CL/sycl/detail/sycl_mem_obj_t.hpp index 5d16eb6034bd8..09639d011f923 100644 --- a/sycl/include/CL/sycl/detail/sycl_mem_obj_t.hpp +++ b/sycl/include/CL/sycl/detail/sycl_mem_obj_t.hpp @@ -75,10 +75,15 @@ class __SYCL_EXPORT SYCLMemObjT : public SYCLMemObjI { std::unique_ptr Allocator) : SYCLMemObjT(/*SizeInBytes*/ 0, Props, std::move(Allocator)) {} + // For ABI compatibility SYCLMemObjT(cl_mem MemObject, const context &SyclContext, const size_t SizeInBytes, event AvailableEvent, std::unique_ptr Allocator); + SYCLMemObjT(pi_native_handle MemObject, const context &SyclContext, + const size_t SizeInBytes, event AvailableEvent, + std::unique_ptr Allocator); + SYCLMemObjT(cl_mem MemObject, const context &SyclContext, event AvailableEvent, std::unique_ptr Allocator) @@ -281,9 +286,13 @@ class __SYCL_EXPORT SYCLMemObjT : public SYCLMemObjI { MAllocator->setAlignment(RequiredAlign); } + // For ABI compatibility static size_t getBufSizeForContext(const ContextImplPtr &Context, cl_mem MemObject); + static size_t getBufSizeForContext(const ContextImplPtr &Context, + pi_native_handle MemObject); + __SYCL_DLL_LOCAL void *allocateMem(ContextImplPtr Context, bool InitFromUserData, void *HostPtr, RT::PiEvent &InteropEvent) override { @@ -320,6 +329,7 @@ class __SYCL_EXPORT SYCLMemObjT : public SYCLMemObjI { ContextImplPtr MInteropContext; // OpenCL's memory object handle passed by user to interoperability // constructor. + // TODO update this member to support other backends. cl_mem MInteropMemObject; // Indicates whether memory object is created using interoperability // constructor or not. diff --git a/sycl/include/CL/sycl/device.hpp b/sycl/include/CL/sycl/device.hpp index 378a9d8860cda..9f095d53dc2b9 100644 --- a/sycl/include/CL/sycl/device.hpp +++ b/sycl/include/CL/sycl/device.hpp @@ -40,8 +40,9 @@ class __SYCL_EXPORT device { /// in accordance with the requirements described in 4.3.1. /// /// \param DeviceId is OpenCL device represented with cl_device_id - __SYCL2020_DEPRECATED("OpenCL interop APIs are deprecated") +#ifdef __SYCL_INTERNAL_API explicit device(cl_device_id DeviceId); +#endif /// Constructs a SYCL device instance using the device selected /// by the DeviceSelector provided. @@ -65,8 +66,9 @@ class __SYCL_EXPORT device { /// /// \return a valid cl_device_id instance in accordance with the requirements /// described in 4.3.1. - __SYCL2020_DEPRECATED("OpenCL interop APIs are deprecated") +#ifdef __SYCL_INTERNAL_API cl_device_id get() const; +#endif /// Check if device is a host device /// diff --git a/sycl/include/CL/sycl/event.hpp b/sycl/include/CL/sycl/event.hpp index 7b01a4bc78540..e1f84a469839a 100644 --- a/sycl/include/CL/sycl/event.hpp +++ b/sycl/include/CL/sycl/event.hpp @@ -41,8 +41,9 @@ class __SYCL_EXPORT event { /// /// \param ClEvent is a valid instance of OpenCL cl_event. /// \param SyclContext is an instance of SYCL context. - __SYCL2020_DEPRECATED("OpenCL interop APIs are deprecated") +#ifdef __SYCL_INTERNAL_API event(cl_event ClEvent, const context &SyclContext); +#endif event(const event &rhs) = default; @@ -59,8 +60,9 @@ class __SYCL_EXPORT event { /// Returns a valid OpenCL event interoperability handle. /// /// \return a valid instance of OpenCL cl_event. - __SYCL2020_DEPRECATED("OpenCL interop APIs are deprecated") +#ifdef __SYCL_INTERNAL_API cl_event get() const; +#endif /// Checks if this event is a SYCL host event. /// diff --git a/sycl/include/CL/sycl/image.hpp b/sycl/include/CL/sycl/image.hpp index d267d0635dff7..c3707bb5bcffa 100644 --- a/sycl/include/CL/sycl/image.hpp +++ b/sycl/include/CL/sycl/image.hpp @@ -224,13 +224,14 @@ class image { PropList); } - __SYCL2020_DEPRECATED("OpenCL interop APIs are deprecated") +#ifdef __SYCL_INTERNAL_API image(cl_mem ClMemObject, const context &SyclContext, event AvailableEvent = {}) { impl = std::make_shared>( ClMemObject, SyclContext, AvailableEvent, make_unique_ptr>()); } +#endif /* -- common interface members -- */ diff --git a/sycl/include/CL/sycl/kernel.hpp b/sycl/include/CL/sycl/kernel.hpp index a73e8b9948a12..e97f2e0e4480f 100644 --- a/sycl/include/CL/sycl/kernel.hpp +++ b/sycl/include/CL/sycl/kernel.hpp @@ -71,9 +71,9 @@ class __SYCL_EXPORT kernel { /// /// \param ClKernel is a valid OpenCL cl_kernel instance /// \param SyclContext is a valid SYCL context - __SYCL2020_DEPRECATED( - "OpenCL interop constructors are deprecated, use make_kernel() instead") +#ifdef __SYCL_INTERNAL_API kernel(cl_kernel ClKernel, const context &SyclContext); +#endif kernel(const kernel &RHS) = default; @@ -94,9 +94,9 @@ class __SYCL_EXPORT kernel { /// an invalid_object_error exception will be thrown. /// /// \return a valid cl_kernel instance - __SYCL2020_DEPRECATED( - "OpenCL interop get() functions are deprecated, use get_native() instead") +#ifdef __SYCL_INTERNAL_API cl_kernel get() const; +#endif /// Check if the associated SYCL context is a SYCL host context. /// diff --git a/sycl/include/CL/sycl/platform.hpp b/sycl/include/CL/sycl/platform.hpp index 143f1cc3bb75b..c1ecd232250a1 100644 --- a/sycl/include/CL/sycl/platform.hpp +++ b/sycl/include/CL/sycl/platform.hpp @@ -44,8 +44,9 @@ class __SYCL_EXPORT platform { /// construction. /// /// \param PlatformId is an OpenCL cl_platform_id instance. - __SYCL2020_DEPRECATED("OpenCL interop APIs are deprecated") +#ifdef __SYCL_INTERNAL_API explicit platform(cl_platform_id PlatformId); +#endif /// Constructs a SYCL platform instance using device selector. /// @@ -71,8 +72,9 @@ class __SYCL_EXPORT platform { /// Returns an OpenCL interoperability platform. /// /// \return an instance of OpenCL cl_platform_id. - __SYCL2020_DEPRECATED("OpenCL interop APIs are deprecated") +#ifdef __SYCL_INTERNAL_API cl_platform_id get() const; +#endif /// Checks if platform supports specified extension. /// diff --git a/sycl/include/CL/sycl/queue.hpp b/sycl/include/CL/sycl/queue.hpp index bb6d994d44f87..80c13abe4d10f 100644 --- a/sycl/include/CL/sycl/queue.hpp +++ b/sycl/include/CL/sycl/queue.hpp @@ -199,9 +199,10 @@ class __SYCL_EXPORT queue { /// \param ClQueue is a valid instance of OpenCL queue. /// \param SyclContext is a valid SYCL context. /// \param AsyncHandler is a SYCL asynchronous exception handler. - __SYCL2020_DEPRECATED("OpenCL interop APIs are deprecated") +#ifdef __SYCL_INTERNAL_API queue(cl_command_queue ClQueue, const context &SyclContext, const async_handler &AsyncHandler = {}); +#endif queue(const queue &RHS) = default; @@ -217,8 +218,9 @@ class __SYCL_EXPORT queue { /// \return a valid instance of OpenCL queue, which is retained before being /// returned. - __SYCL2020_DEPRECATED("OpenCL interop APIs are deprecated") +#ifdef __SYCL_INTERNAL_API cl_command_queue get() const; +#endif /// \return an associated SYCL context. context get_context() const; diff --git a/sycl/include/CL/sycl/sampler.hpp b/sycl/include/CL/sycl/sampler.hpp index d8128ae8dba0c..5ebae973bcd4e 100644 --- a/sycl/include/CL/sycl/sampler.hpp +++ b/sycl/include/CL/sycl/sampler.hpp @@ -68,8 +68,9 @@ class __SYCL_EXPORT sampler { addressing_mode addressingMode, filtering_mode filteringMode, const property_list &propList = {}); - __SYCL2020_DEPRECATED("OpenCL interop APIs are deprecated") +#ifdef __SYCL_INTERNAL_API sampler(cl_sampler clSampler, const context &syclContext); +#endif sampler(const sampler &rhs) = default; diff --git a/sycl/source/detail/sycl_mem_obj_t.cpp b/sycl/source/detail/sycl_mem_obj_t.cpp index 8a43345738216..191a15c0d5b8e 100644 --- a/sycl/source/detail/sycl_mem_obj_t.cpp +++ b/sycl/source/detail/sycl_mem_obj_t.cpp @@ -19,10 +19,16 @@ namespace detail { SYCLMemObjT::SYCLMemObjT(cl_mem MemObject, const context &SyclContext, const size_t SizeInBytes, event AvailableEvent, std::unique_ptr Allocator) + : SYCLMemObjT(pi::cast(MemObject), SyclContext, + SizeInBytes, AvailableEvent, std::move(Allocator)) {} + +SYCLMemObjT::SYCLMemObjT(pi_native_handle MemObject, const context &SyclContext, + const size_t SizeInBytes, event AvailableEvent, + std::unique_ptr Allocator) : MAllocator(std::move(Allocator)), MProps(), MInteropEvent(detail::getSyclObjImpl(std::move(AvailableEvent))), MInteropContext(detail::getSyclObjImpl(SyclContext)), - MInteropMemObject(MemObject), MOpenCLInterop(true), + MInteropMemObject(pi::cast(MemObject)), MOpenCLInterop(true), MHostPtrReadOnly(false), MNeedWriteBack(true), MSizeInBytes(SizeInBytes), MUserPtr(nullptr), MShadowCopy(nullptr), MUploadDataFunctor(nullptr), MSharedPtrStorage(nullptr) { @@ -92,8 +98,13 @@ const plugin &SYCLMemObjT::getPlugin() const { size_t SYCLMemObjT::getBufSizeForContext(const ContextImplPtr &Context, cl_mem MemObject) { + return getBufSizeForContext(Context, pi::cast(MemObject)); +} +size_t SYCLMemObjT::getBufSizeForContext(const ContextImplPtr &Context, + pi_native_handle MemObject) { size_t BufSize = 0; const detail::plugin &Plugin = Context->getPlugin(); + // TODO is there something required to support non-OpenCL backends? Plugin.call( detail::pi::cast(MemObject), CL_MEM_SIZE, sizeof(size_t), &BufSize, nullptr); diff --git a/sycl/test/abi/sycl_symbols_linux.dump b/sycl/test/abi/sycl_symbols_linux.dump index 04d8c1cefabbe..6a2a84342b386 100644 --- a/sycl/test/abi/sycl_symbols_linux.dump +++ b/sycl/test/abi/sycl_symbols_linux.dump @@ -3774,8 +3774,11 @@ _ZN2cl4sycl6detail11SYCLMemObjT16determineHostPtrERKSt10shared_ptrINS1_12context _ZN2cl4sycl6detail11SYCLMemObjT16updateHostMemoryEPv _ZN2cl4sycl6detail11SYCLMemObjT16updateHostMemoryEv _ZN2cl4sycl6detail11SYCLMemObjT20getBufSizeForContextERKSt10shared_ptrINS1_12context_implEEP7_cl_mem +_ZN2cl4sycl6detail11SYCLMemObjT20getBufSizeForContextERKSt10shared_ptrINS1_12context_implEEm _ZN2cl4sycl6detail11SYCLMemObjTC1EP7_cl_memRKNS0_7contextEmNS0_5eventESt10unique_ptrINS1_19SYCLMemObjAllocatorESt14default_deleteISA_EE +_ZN2cl4sycl6detail11SYCLMemObjTC1EmRKNS0_7contextEmNS0_5eventESt10unique_ptrINS1_19SYCLMemObjAllocatorESt14default_deleteIS8_EE _ZN2cl4sycl6detail11SYCLMemObjTC2EP7_cl_memRKNS0_7contextEmNS0_5eventESt10unique_ptrINS1_19SYCLMemObjAllocatorESt14default_deleteISA_EE +_ZN2cl4sycl6detail11SYCLMemObjTC2EmRKNS0_7contextEmNS0_5eventESt10unique_ptrINS1_19SYCLMemObjAllocatorESt14default_deleteIS8_EE _ZN2cl4sycl6detail11buffer_impl11allocateMemESt10shared_ptrINS1_12context_implEEbPvRP9_pi_event _ZN2cl4sycl6detail11make_deviceEmNS0_7backendE _ZN2cl4sycl6detail11make_kernelERKNS0_7contextERKNS0_13kernel_bundleILNS0_12bundle_stateE2EEEmbNS0_7backendE diff --git a/sycl/test/abi/sycl_symbols_windows.dump b/sycl/test/abi/sycl_symbols_windows.dump index 57c29ebfb6d98..306dcf785c388 100644 --- a/sycl/test/abi/sycl_symbols_windows.dump +++ b/sycl/test/abi/sycl_symbols_windows.dump @@ -258,6 +258,7 @@ ??0SYCLMemObjT@detail@sycl@cl@@QEAA@AEBVproperty_list@23@V?$unique_ptr@VSYCLMemObjAllocator@detail@sycl@cl@@U?$default_delete@VSYCLMemObjAllocator@detail@sycl@cl@@@std@@@std@@@Z ??0SYCLMemObjT@detail@sycl@cl@@QEAA@PEAU_cl_mem@@AEBVcontext@23@Vevent@23@V?$unique_ptr@VSYCLMemObjAllocator@detail@sycl@cl@@U?$default_delete@VSYCLMemObjAllocator@detail@sycl@cl@@@std@@@std@@@Z ??0SYCLMemObjT@detail@sycl@cl@@QEAA@PEAU_cl_mem@@AEBVcontext@23@_KVevent@23@V?$unique_ptr@VSYCLMemObjAllocator@detail@sycl@cl@@U?$default_delete@VSYCLMemObjAllocator@detail@sycl@cl@@@std@@@std@@@Z +??0SYCLMemObjT@detail@sycl@cl@@QEAA@_KAEBVcontext@23@_KVevent@23@V?$unique_ptr@VSYCLMemObjAllocator@detail@sycl@cl@@U?$default_delete@VSYCLMemObjAllocator@detail@sycl@cl@@@std@@@std@@@Z ??0SYCLMemObjT@detail@sycl@cl@@QEAA@_KAEBVproperty_list@23@V?$unique_ptr@VSYCLMemObjAllocator@detail@sycl@cl@@U?$default_delete@VSYCLMemObjAllocator@detail@sycl@cl@@@std@@@std@@@Z ??0accelerator_selector@sycl@cl@@QEAA@$$QEAV012@@Z ??0accelerator_selector@sycl@cl@@QEAA@AEBV012@@Z @@ -266,6 +267,7 @@ ??0buffer_impl@detail@sycl@cl@@QEAA@PEAX_K1AEBVproperty_list@23@V?$unique_ptr@VSYCLMemObjAllocator@detail@sycl@cl@@U?$default_delete@VSYCLMemObjAllocator@detail@sycl@cl@@@std@@@std@@@Z ??0buffer_impl@detail@sycl@cl@@QEAA@PEBX_K1AEBVproperty_list@23@V?$unique_ptr@VSYCLMemObjAllocator@detail@sycl@cl@@U?$default_delete@VSYCLMemObjAllocator@detail@sycl@cl@@@std@@@std@@@Z ??0buffer_impl@detail@sycl@cl@@QEAA@_K0AEBVproperty_list@23@V?$unique_ptr@VSYCLMemObjAllocator@detail@sycl@cl@@U?$default_delete@VSYCLMemObjAllocator@detail@sycl@cl@@@std@@@std@@@Z +??0buffer_impl@detail@sycl@cl@@QEAA@_KAEBVcontext@23@_KV?$unique_ptr@VSYCLMemObjAllocator@detail@sycl@cl@@U?$default_delete@VSYCLMemObjAllocator@detail@sycl@cl@@@std@@@std@@Vevent@23@@Z ??0context@sycl@cl@@AEAA@V?$shared_ptr@Vcontext_impl@detail@sycl@cl@@@std@@@Z ??0context@sycl@cl@@QEAA@$$QEAV012@@Z ??0context@sycl@cl@@QEAA@AEBV012@@Z @@ -2036,6 +2038,7 @@ ?getAssertHappenedBuffer@queue@sycl@cl@@AEAAAEAV?$buffer@UAssertHappened@detail@sycl@cl@@$00V?$aligned_allocator@D@234@X@23@XZ ?getBorderColor@detail@sycl@cl@@YA?AV?$vec@M$03@23@W4image_channel_order@23@@Z ?getBufSizeForContext@SYCLMemObjT@detail@sycl@cl@@SA_KAEBV?$shared_ptr@Vcontext_impl@detail@sycl@cl@@@std@@PEAU_cl_mem@@@Z +?getBufSizeForContext@SYCLMemObjT@detail@sycl@cl@@SA_KAEBV?$shared_ptr@Vcontext_impl@detail@sycl@cl@@@std@@_K@Z ?getChannelOrder@?$image_impl@$00@detail@sycl@cl@@QEBA?AW4image_channel_order@34@XZ ?getChannelOrder@?$image_impl@$01@detail@sycl@cl@@QEBA?AW4image_channel_order@34@XZ ?getChannelOrder@?$image_impl@$02@detail@sycl@cl@@QEBA?AW4image_channel_order@34@XZ diff --git a/sycl/test/basic_tests/context.cpp b/sycl/test/basic_tests/context.cpp index 4d3730dd7338d..3d38c762c198e 100644 --- a/sycl/test/basic_tests/context.cpp +++ b/sycl/test/basic_tests/context.cpp @@ -25,9 +25,6 @@ int main() { context MovedContext(std::move(Context)); assert(hash == std::hash()(MovedContext)); assert(deviceA.is_host() == MovedContext.is_host()); - if (!deviceA.is_host()) { - assert(MovedContext.get() != nullptr); - } } { std::cout << "move assignment operator" << std::endl; @@ -37,9 +34,6 @@ int main() { WillMovedContext = std::move(Context); assert(hash == std::hash()(WillMovedContext)); assert(deviceA.is_host() == WillMovedContext.is_host()); - if (!deviceA.is_host()) { - assert(WillMovedContext.get() != nullptr); - } } { std::cout << "copy constructor" << std::endl; diff --git a/sycl/test/basic_tests/device.cpp b/sycl/test/basic_tests/device.cpp index db60824c7bd05..5720f6f6e8130 100644 --- a/sycl/test/basic_tests/device.cpp +++ b/sycl/test/basic_tests/device.cpp @@ -67,9 +67,6 @@ int main() { device MovedDevice(std::move(Device)); assert(hash == std::hash()(MovedDevice)); assert(deviceA.is_host() == MovedDevice.is_host()); - if (!deviceA.is_host()) { - assert(MovedDevice.get() != nullptr); - } } { std::cout << "move assignment operator" << std::endl; @@ -79,9 +76,6 @@ int main() { WillMovedDevice = std::move(Device); assert(hash == std::hash()(WillMovedDevice)); assert(deviceA.is_host() == WillMovedDevice.is_host()); - if (!deviceA.is_host()) { - assert(WillMovedDevice.get() != nullptr); - } } { std::cout << "copy constructor" << std::endl; diff --git a/sycl/test/warnings/sycl_2020_deprecations.cpp b/sycl/test/warnings/sycl_2020_deprecations.cpp index 81c4792149c33..4085f029e341b 100644 --- a/sycl/test/warnings/sycl_2020_deprecations.cpp +++ b/sycl/test/warnings/sycl_2020_deprecations.cpp @@ -8,57 +8,57 @@ int main() { cl_context ClCtx; - // expected-warning@+1 {{'context' is deprecated: OpenCL interop APIs are deprecated}} + // expected-error@+1 {{no matching constructor for initialization of 'sycl::context'}} sycl::context Ctx{ClCtx}; - // expected-warning@+1 {{'get' is deprecated: OpenCL interop APIs are deprecated}} + // expected-error@+1 {{no member named 'get' in 'sycl::context'}} (void)Ctx.get(); cl_mem Mem; - // expected-warning@+1 {{'buffer' is deprecated: OpenCL interop APIs are deprecated}} + // expected-error@+1 {{no matching constructor for initialization of 'sycl::buffer'}} sycl::buffer Buf{Mem, Ctx}; (void)Buf; cl_device_id DevId; - // expected-warning@+1 {{'device' is deprecated: OpenCL interop APIs are deprecated}} + // expected-error@+1 {{no matching constructor for initialization of 'sycl::device'}} sycl::device Device{DevId}; - // expected-warning@+1 {{'get' is deprecated: OpenCL interop APIs are deprecated}} + // expected-error@+1 {{no member named 'get' in 'sycl::device'}} (void)Device.get(); // expected-warning@+1 {{'has_extension' is deprecated: use device::has() function with aspects APIs instead}} (void)Device.has_extension("abc"); cl_event ClEvent; - // expected-warning@+1 {{'event' is deprecated: OpenCL interop APIs are deprecated}} + // expected-error@+1 {{no matching constructor for initialization of 'sycl::event'}} sycl::event Evt{ClEvent, Ctx}; - // expected-warning@+1 {{'get' is deprecated: OpenCL interop APIs are deprecated}} + // expected-error@+1 {{no member named 'get' in 'sycl::event'}} (void)Evt.get(); - // expected-warning@+1 {{'image' is deprecated: OpenCL interop APIs are deprecated}} + // expected-error@+1 {{no matching constructor for initialization of 'sycl::image<1>'}} sycl::image<1> Img{Mem, Ctx}; (void)Img; cl_platform_id ClPlatform; - // expected-warning@+1 {{'platform' is deprecated: OpenCL interop APIs are deprecated}} + // expected-error@+1 {{no matching constructor for initialization of 'sycl::platform'}} sycl::platform Platform{ClPlatform}; - // expected-warning@+1 {{'get' is deprecated: OpenCL interop APIs are deprecated}} + // expected-error@+1 {{no member named 'get' in 'sycl::platform'}} (void)Platform.get(); // expected-warning@+1 {{'has_extension' is deprecated: use platform::has() function with aspects APIs instead}} (void)Platform.has_extension("abc"); cl_command_queue ClQueue; - // expected-warning@+1 {{'queue' is deprecated: OpenCL interop APIs are deprecated}} + // expected-error@+1 {{no matching constructor for initialization of 'sycl::queue'}} sycl::queue Queue{ClQueue, Ctx}; - // expected-warning@+1 {{'get' is deprecated: OpenCL interop APIs are deprecated}} + // expected-error@+1 {{no member named 'get' in 'sycl::queue'}} (void)Queue.get(); cl_sampler ClSampler; - // expected-warning@+1 {{'sampler' is deprecated: OpenCL interop APIs are deprecated}} + // expected-error@+1 {{no matching constructor for initialization of 'sycl::sampler'}} sycl::sampler Sampler{ClSampler, Ctx}; (void)Sampler; cl_kernel ClKernel; - // expected-warning@+1 {{'kernel' is deprecated: OpenCL interop constructors are deprecated, use make_kernel() instead}} + // expected-error@+1 {{no matching constructor for initialization of 'sycl::kernel'}} sycl::kernel Kernel{ClKernel, Ctx}; - // expected-warning@+1 {{'get' is deprecated: OpenCL interop get() functions are deprecated, use get_native() instead}} + // expected-error@+1 {{no member named 'get' in 'sycl::kernel'}} (void)Kernel.get(); // expected-warning@+1 {{'program' is deprecated: program class is deprecated, use kernel_bundle instead}} diff --git a/sycl/unittests/scheduler/NoHostUnifiedMemory.cpp b/sycl/unittests/scheduler/NoHostUnifiedMemory.cpp index d46b3cff9862b..3157d20e0ec95 100644 --- a/sycl/unittests/scheduler/NoHostUnifiedMemory.cpp +++ b/sycl/unittests/scheduler/NoHostUnifiedMemory.cpp @@ -205,7 +205,8 @@ TEST_F(SchedulerTest, NoHostUnifiedMemory) { InteropPiContext = detail::getSyclObjImpl(InteropContext)->getHandleRef(); std::shared_ptr BufI = std::make_shared< detail::buffer_impl>( - MockInteropBuffer, Q.get_context(), /*BufSize*/ 8, + detail::pi::cast(MockInteropBuffer), Q.get_context(), + /*BufSize*/ 8, make_unique_ptr>(), event());