diff --git a/sycl/include/sycl/detail/backend_traits_cuda.hpp b/sycl/include/sycl/detail/backend_traits_cuda.hpp index 564966eef51fd..89bef47d01a4b 100644 --- a/sycl/include/sycl/detail/backend_traits_cuda.hpp +++ b/sycl/include/sycl/detail/backend_traits_cuda.hpp @@ -14,7 +14,6 @@ #pragma once -#include #include #include #include @@ -35,6 +34,9 @@ typedef unsigned int CUdeviceptr; namespace sycl { inline namespace _V1 { + +class context; + namespace detail { // TODO the interops for context, device, event, platform and program diff --git a/sycl/include/sycl/detail/backend_traits_hip.hpp b/sycl/include/sycl/detail/backend_traits_hip.hpp index c8ae3f2e2c7ec..9f7cbb2bfdd91 100644 --- a/sycl/include/sycl/detail/backend_traits_hip.hpp +++ b/sycl/include/sycl/detail/backend_traits_hip.hpp @@ -14,7 +14,6 @@ #pragma once -#include #include #include #include @@ -29,6 +28,9 @@ typedef void *HIPdeviceptr; namespace sycl { inline namespace _V1 { + +class context; + namespace detail { // TODO the interops for context, device, event, platform and program diff --git a/sycl/include/sycl/detail/backend_traits_level_zero.hpp b/sycl/include/sycl/detail/backend_traits_level_zero.hpp index ef49a0a702bbb..f2220c863c123 100644 --- a/sycl/include/sycl/detail/backend_traits_level_zero.hpp +++ b/sycl/include/sycl/detail/backend_traits_level_zero.hpp @@ -16,7 +16,6 @@ #pragma once #include // for backend -#include // for context #include // for BackendI... #include // for device #include // for event @@ -45,6 +44,7 @@ typedef struct _ze_module_handle_t *ze_module_handle_t; namespace sycl { inline namespace _V1 { class queue; +class context; namespace detail { diff --git a/sycl/include/sycl/detail/backend_traits_opencl.hpp b/sycl/include/sycl/detail/backend_traits_opencl.hpp index fe253aaae055c..b203013c0e903 100644 --- a/sycl/include/sycl/detail/backend_traits_opencl.hpp +++ b/sycl/include/sycl/detail/backend_traits_opencl.hpp @@ -16,7 +16,6 @@ #pragma once #include // for backend -#include // for context #include // for BackendInput, BackendReturn #include // for _cl_event, cl_event, cl_de... #include // for assertion and ur handles @@ -35,6 +34,7 @@ template class kernel_bundle; class queue; template class buffer; +class context; namespace detail { diff --git a/sycl/include/sycl/handler.hpp b/sycl/include/sycl/handler.hpp index 92a2e4428fe4b..11e54e4143461 100644 --- a/sycl/include/sycl/handler.hpp +++ b/sycl/include/sycl/handler.hpp @@ -10,7 +10,6 @@ #include #include -#include #include #include #include @@ -170,6 +169,7 @@ class kernel_impl; class queue_impl; class stream_impl; class event_impl; +class context_impl; template class image_accessor; diff --git a/sycl/include/sycl/image.hpp b/sycl/include/sycl/image.hpp index 4fcd2f5322990..9a2c5fe1dedb9 100644 --- a/sycl/include/sycl/image.hpp +++ b/sycl/include/sycl/image.hpp @@ -12,7 +12,6 @@ #include // for cl_float, cl_half #include // for backend, backe... #include // for range -#include // for context #include // for aligned_allocator #include // for InteropFeature... #include // for convertToArrayOfN @@ -43,6 +42,7 @@ inline namespace _V1 { // forward declarations class handler; +class context; template class image; diff --git a/sycl/include/sycl/kernel_bundle.hpp b/sycl/include/sycl/kernel_bundle.hpp index be68572ad84a3..a61019efdbf5d 100644 --- a/sycl/include/sycl/kernel_bundle.hpp +++ b/sycl/include/sycl/kernel_bundle.hpp @@ -9,7 +9,6 @@ #pragma once #include // for backend, backend_return_t -#include // for context #include // for __SYCL_EXPORT #include // for get_spec_constant_symboli... #include // for OwnerLessBase @@ -46,6 +45,7 @@ template class backend_traits; template auto get_native(const kernel_bundle &Obj) -> backend_return_t>; +class context; namespace detail { class kernel_id_impl; diff --git a/sycl/include/sycl/queue.hpp b/sycl/include/sycl/queue.hpp index e4fce00ff0288..dd8b9f1e23c6e 100644 --- a/sycl/include/sycl/queue.hpp +++ b/sycl/include/sycl/queue.hpp @@ -14,7 +14,6 @@ #include // for async_handler #include // for backend, backe... #include // for buffer -#include // for context #include // for AssertHappened #include // for check_fn_signa... #include // for code_location diff --git a/sycl/include/sycl/usm.hpp b/sycl/include/sycl/usm.hpp index 44da92c96a43b..43713f84f7092 100644 --- a/sycl/include/sycl/usm.hpp +++ b/sycl/include/sycl/usm.hpp @@ -8,7 +8,6 @@ #pragma once #include -#include #include #include #include @@ -21,6 +20,9 @@ namespace sycl { inline namespace _V1 { + +class context; + /// // Explicit USM /// diff --git a/sycl/source/platform.cpp b/sycl/source/platform.cpp index 17de8c1700a89..841aeb76f8d4b 100644 --- a/sycl/source/platform.cpp +++ b/sycl/source/platform.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include