Skip to content
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

[SYCL][ABI-break] Remove deprecated interop_task #10246

Merged
merged 5 commits into from
Jul 11, 2023
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/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ set(SYCL_MAJOR_VERSION 7)
set(SYCL_MINOR_VERSION 0)
set(SYCL_PATCH_VERSION 0)

set(SYCL_DEV_ABI_VERSION 6)
set(SYCL_DEV_ABI_VERSION 7)
if (SYCL_ADD_DEV_VERSION_POSTFIX)
set(SYCL_VERSION_POSTFIX "-${SYCL_DEV_ABI_VERSION}")
endif()
Expand Down
1 change: 0 additions & 1 deletion sycl/include/sycl/backend.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ get_native<backend::ext_oneapi_cuda, device>(const device &Obj) {
}
#endif

// Native handle of an accessor should be accessed through interop_handler
template <backend BackendName, typename DataT, int Dimensions,
access::mode AccessMode, access::target AccessTarget,
access::placeholder IsPlaceholder>
Expand Down
22 changes: 1 addition & 21 deletions sycl/include/sycl/detail/backend_traits_cuda.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#pragma once

#include <sycl/accessor.hpp>
#include <sycl/context.hpp>
#include <sycl/detail/backend_traits.hpp>
#include <sycl/device.hpp>
Expand All @@ -41,9 +40,7 @@ namespace detail {

// TODO the interops for context, device, event, platform and program
// may be removed after removing the deprecated 'get_native()' methods
// from the corresponding classes. The interop<backend, queue> specialization
// is also used in the get_queue() method of the deprecated class
// interop_handler and also can be removed after API cleanup.
// from the corresponding classes.
template <> struct interop<backend::ext_oneapi_cuda, context> {
using type = CUcontext;
};
Expand All @@ -60,23 +57,6 @@ template <> struct interop<backend::ext_oneapi_cuda, queue> {
using type = CUstream;
};

// TODO the interops for accessor is used in the already deprecated class
// interop_handler and can be removed after API cleanup.
template <typename DataT, int Dimensions, access::mode AccessMode>
struct interop<backend::ext_oneapi_cuda,
accessor<DataT, Dimensions, AccessMode, access::target::device,
access::placeholder::false_t>> {
using type = CUdeviceptr;
};

template <typename DataT, int Dimensions, access::mode AccessMode>
struct interop<
backend::ext_oneapi_cuda,
accessor<DataT, Dimensions, AccessMode, access::target::constant_buffer,
access::placeholder::false_t>> {
using type = CUdeviceptr;
};

template <typename DataT, int Dimensions, typename AllocatorT>
struct BackendInput<backend::ext_oneapi_cuda,
buffer<DataT, Dimensions, AllocatorT>> {
Expand Down
22 changes: 1 addition & 21 deletions sycl/include/sycl/detail/backend_traits_hip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#pragma once

#include <sycl/accessor.hpp>
#include <sycl/context.hpp>
#include <sycl/detail/backend_traits.hpp>
#include <sycl/device.hpp>
Expand All @@ -35,9 +34,7 @@ namespace detail {

// TODO the interops for context, device, event, platform and program
// may be removed after removing the deprecated 'get_native()' methods
// from the corresponding classes. The interop<backend, queue> specialization
// is also used in the get_queue() method of the deprecated class
// interop_handler and also can be removed after API cleanup.
// from the corresponding classes.
template <> struct interop<backend::ext_oneapi_hip, context> {
using type = HIPcontext;
};
Expand All @@ -54,23 +51,6 @@ template <> struct interop<backend::ext_oneapi_hip, queue> {
using type = HIPstream;
};

// TODO the interops for accessor is used in the already deprecated class
// interop_handler and can be removed after API cleanup.
template <typename DataT, int Dimensions, access::mode AccessMode>
struct interop<backend::ext_oneapi_hip,
accessor<DataT, Dimensions, AccessMode, access::target::device,
access::placeholder::false_t>> {
using type = HIPdeviceptr;
};

template <typename DataT, int Dimensions, access::mode AccessMode>
struct interop<
backend::ext_oneapi_hip,
accessor<DataT, Dimensions, AccessMode, access::target::constant_buffer,
access::placeholder::false_t>> {
using type = HIPdeviceptr;
};

template <typename DataT, int Dimensions, typename AllocatorT>
struct BackendInput<backend::ext_oneapi_hip,
buffer<DataT, Dimensions, AllocatorT>> {
Expand Down
29 changes: 1 addition & 28 deletions sycl/include/sycl/detail/backend_traits_level_zero.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

#pragma once

#include <sycl/accessor.hpp>
#include <sycl/context.hpp>
#include <sycl/detail/backend_traits.hpp>
#include <sycl/detail/defines.hpp>
Expand Down Expand Up @@ -46,9 +45,7 @@ class device_impl;

// TODO the interops for context, device, event, platform and program
// may be removed after removing the deprecated 'get_native()' methods
// from the corresponding classes. The interop<backend, queue> specialization
// is also used in the get_queue() method of the deprecated class
// interop_handler and also can be removed after API cleanup.
// from the corresponding classes.
template <> struct interop<backend::ext_oneapi_level_zero, context> {
using type = ze_context_handle_t;
};
Expand All @@ -70,30 +67,6 @@ template <> struct interop<backend::ext_oneapi_level_zero, platform> {
using type = ze_driver_handle_t;
};

// TODO the interops for accessor is used in the already deprecated class
// interop_handler and can be removed after API cleanup.
template <typename DataT, int Dimensions, access::mode AccessMode>
struct interop<backend::ext_oneapi_level_zero,
accessor<DataT, Dimensions, AccessMode, access::target::device,
access::placeholder::false_t>> {
using type = char *;
};

template <typename DataT, int Dimensions, access::mode AccessMode>
struct interop<
backend::ext_oneapi_level_zero,
accessor<DataT, Dimensions, AccessMode, access::target::constant_buffer,
access::placeholder::false_t>> {
using type = char *;
};

template <typename DataT, int Dimensions, access::mode AccessMode>
struct interop<backend::ext_oneapi_level_zero,
accessor<DataT, Dimensions, AccessMode, access::target::image,
access::placeholder::false_t>> {
using type = ze_image_handle_t;
};

template <> struct interop<backend::ext_oneapi_level_zero, kernel> {
using type = ze_kernel_handle_t;
};
Expand Down
28 changes: 1 addition & 27 deletions sycl/include/sycl/detail/backend_traits_opencl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

#pragma once

#include <sycl/accessor.hpp>
#include <sycl/context.hpp>
#include <sycl/detail/backend_traits.hpp>
#include <sycl/detail/defines.hpp>
Expand All @@ -31,9 +30,7 @@ namespace detail {

// TODO the interops for context, device, event, platform and program
// may be removed after removing the deprecated 'get_native()' methods
// from the corresponding classes. The interop<backend, queue> specialization
// is also used in the get_queue() method of the deprecated class
// interop_handler and also can be removed after API cleanup.
// from the corresponding classes.
template <> struct interop<backend::opencl, context> {
using type = cl_context;
};
Expand All @@ -50,29 +47,6 @@ template <> struct interop<backend::opencl, platform> {
using type = cl_platform_id;
};

// TODO the interops for accessor is used in the already deprecated class
// interop_handler and can be removed after API cleanup.
template <typename DataT, int Dimensions, access::mode AccessMode>
struct interop<backend::opencl,
accessor<DataT, Dimensions, AccessMode, access::target::device,
access::placeholder::false_t>> {
using type = cl_mem;
};

template <typename DataT, int Dimensions, access::mode AccessMode>
struct interop<backend::opencl, accessor<DataT, Dimensions, AccessMode,
access::target::constant_buffer,
access::placeholder::false_t>> {
using type = cl_mem;
};

template <typename DataT, int Dimensions, access::mode AccessMode>
struct interop<backend::opencl,
accessor<DataT, Dimensions, AccessMode, access::target::image,
access::placeholder::false_t>> {
using type = cl_mem;
};

template <typename DataT, int Dimensions, typename AllocatorT>
struct BackendInput<backend::opencl, buffer<DataT, Dimensions, AllocatorT>> {
using type = cl_mem;
Expand Down
13 changes: 0 additions & 13 deletions sycl/include/sycl/detail/cg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <sycl/group.hpp>
#include <sycl/id.hpp>
#include <sycl/interop_handle.hpp>
#include <sycl/interop_handler.hpp>
#include <sycl/kernel.hpp>
#include <sycl/nd_item.hpp>
#include <sycl/range.hpp>
Expand Down Expand Up @@ -66,7 +65,6 @@ class CG {
CopyUSM = 10,
FillUSM = 11,
PrefetchUSM = 12,
CodeplayInteropTask = 13,
CodeplayHostTask = 14,
AdviseUSM = 15,
Copy2DUSM = 16,
Expand Down Expand Up @@ -330,17 +328,6 @@ class CGAdviseUSM : public CG {
pi_mem_advice getAdvice() { return MAdvice; }
};

class CGInteropTask : public CG {
public:
std::unique_ptr<InteropTask> MInteropTask;

CGInteropTask(std::unique_ptr<InteropTask> InteropTask,
CG::StorageInitHelper CGData, CGTYPE Type,
detail::code_location loc = {})
: CG(Type, std::move(CGData), std::move(loc)),
MInteropTask(std::move(InteropTask)) {}
};

class CGHostTask : public CG {
public:
std::unique_ptr<HostTask> MHostTask;
Expand Down
9 changes: 0 additions & 9 deletions sycl/include/sycl/detail/cg_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <sycl/group.hpp>
#include <sycl/id.hpp>
#include <sycl/interop_handle.hpp>
#include <sycl/interop_handler.hpp>
#include <sycl/kernel.hpp>
#include <sycl/kernel_handler.hpp>
#include <sycl/nd_item.hpp>
Expand Down Expand Up @@ -217,14 +216,6 @@ class HostKernelBase {
virtual ~HostKernelBase() = default;
};

class InteropTask {
std::function<void(sycl::interop_handler)> MFunc;

public:
InteropTask(std::function<void(sycl::interop_handler)> Func) : MFunc(Func) {}
void call(sycl::interop_handler &h) { MFunc(h); }
};

class HostTask {
std::function<void()> MHostTask;
std::function<void(interop_handle)> MInteropTask;
Expand Down
13 changes: 0 additions & 13 deletions sycl/include/sycl/handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1901,17 +1901,6 @@ class __SYCL_EXPORT handler {
#endif
}

/// Invokes a lambda on the host. Dependencies are satisfied on the host.
///
/// \param Func is a lambda that is executed on the host
template <typename FuncT>
__SYCL_DEPRECATED("interop_task() is deprecated, use host_task() instead")
void interop_task(FuncT Func) {

MInteropTask.reset(new detail::InteropTask(std::move(Func)));
setType(detail::CG::CodeplayInteropTask);
}

/// Defines and invokes a SYCL kernel function for the specified range.
///
/// \param Kernel is a SYCL kernel that is executed on a SYCL device
Expand Down Expand Up @@ -2966,8 +2955,6 @@ class __SYCL_EXPORT handler {
std::unique_ptr<detail::HostKernelBase> MHostKernel;
/// Storage for lambda/function when using HostTask
std::unique_ptr<detail::HostTask> MHostTask;
// Storage for a lambda or function when using InteropTasks
std::unique_ptr<detail::InteropTask> MInteropTask;
/// The list of valid SYCL events that need to complete
/// before barrier command can be executed
std::vector<detail::EventImplPtr> MEventsWaitWithBarrier;
Expand Down
79 changes: 0 additions & 79 deletions sycl/include/sycl/interop_handler.hpp

This file was deleted.

1 change: 0 additions & 1 deletion sycl/source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ set(SYCL_SOURCES
"handler.cpp"
"image.cpp"
"interop_handle.cpp"
"interop_handler.cpp"
"kernel.cpp"
"kernel_bundle.cpp"
"platform.cpp"
Expand Down
7 changes: 0 additions & 7 deletions sycl/source/detail/graph_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,6 @@ class node_impl {
case sycl::detail::CG::Kernel:
case sycl::detail::CG::RunOnHostIntel:
return createCGCopy<sycl::detail::CGExecKernel>();
case sycl::detail::CG::CodeplayInteropTask:
assert(false);
break;
// TODO: Uncomment this once we implement support for interop task so we can
// test required changes to the CG class.

// return createCGCopy<sycl::detail::CGInteropTask>();
case sycl::detail::CG::CopyAccToPtr:
case sycl::detail::CG::CopyPtrToAcc:
case sycl::detail::CG::CopyAccToAcc:
Expand Down
Loading