diff --git a/sycl/include/sycl/info/context.hpp b/sycl/include/sycl/info/context.hpp index e99ee1f5146e5..08c4435d62325 100644 --- a/sycl/include/sycl/info/context.hpp +++ b/sycl/include/sycl/info/context.hpp @@ -31,9 +31,14 @@ using context_traits = using context_runtime_traits = sycl::detail::rt_traits_base; -struct reference_count : context_traits { +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES +#include +struct __SYCL_DEPRECATED("info::context::reference_count is not part of " + "SYCL 2020") reference_count + : context_traits { using return_type = uint32_t; }; +#endif // __INTEL_PREVIEW_BREAKING_CHANGES struct platform : context_runtime_traits { using return_type = sycl::platform; }; diff --git a/sycl/include/sycl/info/device.hpp b/sycl/include/sycl/info/device.hpp index 40b40e2774ac0..d876c8adbf739 100644 --- a/sycl/include/sycl/info/device.hpp +++ b/sycl/include/sycl/info/device.hpp @@ -418,9 +418,13 @@ struct __SYCL_DEPRECATED("use sycl::aspect::atomic64 instead") atomic64 }; #endif // __INTEL_PREVIEW_BREAKING_CHANGES -struct reference_count : device_traits { +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES +struct __SYCL_DEPRECATED("info::device::reference_count is not part of " + "SYCL 2020") reference_count + : device_traits { using return_type = uint32_t; }; +#endif // __INTEL_PREVIEW_BREAKING_CHANGES // To be dropped (has alternatives/not needed) struct usm_device_allocations : device_traits { diff --git a/sycl/include/sycl/info/event.hpp b/sycl/include/sycl/info/event.hpp index aef60c0ec2f84..532d93209e42e 100644 --- a/sycl/include/sycl/info/event.hpp +++ b/sycl/include/sycl/info/event.hpp @@ -36,9 +36,14 @@ struct command_execution_status : event_traits { using return_type = info::event_command_status; }; -struct reference_count : event_traits { +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES +#include +struct __SYCL_DEPRECATED("info::event::reference_count is not part of " + "SYCL 2020") reference_count + : event_traits { using return_type = uint32_t; }; +#endif // __INTEL_PREVIEW_BREAKING_CHANGES } // namespace event namespace event_profiling { template diff --git a/sycl/include/sycl/info/kernel.hpp b/sycl/include/sycl/info/kernel.hpp index eec1f242635c2..c5bbcc0f97cfd 100644 --- a/sycl/include/sycl/info/kernel.hpp +++ b/sycl/include/sycl/info/kernel.hpp @@ -38,9 +38,14 @@ struct attributes : kernel_traits { struct function_name : kernel_traits { using return_type = std::string; }; -struct reference_count : kernel_traits { +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES +#include +struct __SYCL_DEPRECATED("info::kernel::reference_count is not part of " + "SYCL 2020") reference_count + : kernel_traits { using return_type = uint32_t; }; +#endif // __INTEL_PREVIEW_BREAKING_CHANGES struct context : kernel_traits { using return_type = sycl::context; }; diff --git a/sycl/include/sycl/info/queue.hpp b/sycl/include/sycl/info/queue.hpp index c4f710a6fbcaf..44f7f0a0a6f86 100644 --- a/sycl/include/sycl/info/queue.hpp +++ b/sycl/include/sycl/info/queue.hpp @@ -32,9 +32,14 @@ struct context : queue_traits { struct device : queue_traits { using return_type = sycl::device; }; -struct reference_count : queue_traits { +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES +#include +struct __SYCL_DEPRECATED("info::queue::reference_count is not part of " + "SYCL 2020") reference_count + : queue_traits { using return_type = uint32_t; }; +#endif // __INTEL_PREVIEW_BREAKING_CHANGES } // namespace queue } // namespace info diff --git a/sycl/source/context.cpp b/sycl/source/context.cpp index 56fe282221c8d..a735952731b7d 100644 --- a/sycl/source/context.cpp +++ b/sycl/source/context.cpp @@ -92,7 +92,9 @@ context::get_info() const { #define __SYCL_CONTEXT_INFO_INST(NAME, RETURN_T) \ template __SYCL_EXPORT RETURN_T context::get_info() \ const; +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES __SYCL_CONTEXT_INFO_INST(reference_count, uint32_t) +#endif // __INTEL_PREVIEW_BREAKING_CHANGES __SYCL_CONTEXT_INFO_INST(platform, sycl::platform) __SYCL_CONTEXT_INFO_INST(devices, std::vector) __SYCL_CONTEXT_INFO_INST(atomic_memory_order_capabilities, diff --git a/sycl/source/detail/context_impl.cpp b/sycl/source/detail/context_impl.cpp index d65e2395d2c1f..79bfdf8f1ebfd 100644 --- a/sycl/source/detail/context_impl.cpp +++ b/sycl/source/detail/context_impl.cpp @@ -143,11 +143,13 @@ const async_handler &context_impl::get_async_handler() const { return MAsyncHandler; } +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES template <> uint32_t context_impl::get_info() const { return get_context_info(this->getHandleRef(), this->getAdapter()); } +#endif // __INTEL_PREVIEW_BREAKING_CHANGES template <> platform context_impl::get_info() const { return createSyclObjFromImpl(MPlatform); } diff --git a/sycl/source/detail/event_impl.cpp b/sycl/source/detail/event_impl.cpp index 6b7957bf781bd..273442c4bada2 100644 --- a/sycl/source/detail/event_impl.cpp +++ b/sycl/source/detail/event_impl.cpp @@ -402,6 +402,7 @@ uint64_t event_impl::get_profiling_info() { return MHostProfilingInfo->getEndTime(); } +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES template <> uint32_t event_impl::get_info() { auto Handle = this->getHandle(); if (!MIsHostEvent && Handle) { @@ -410,6 +411,7 @@ template <> uint32_t event_impl::get_info() { } return 0; } +#endif // __INTEL_PREVIEW_BREAKING_CHANGES template <> info::event_command_status diff --git a/sycl/source/detail/queue_impl.cpp b/sycl/source/detail/queue_impl.cpp index ed901c976410b..cb483ebd214c7 100644 --- a/sycl/source/detail/queue_impl.cpp +++ b/sycl/source/detail/queue_impl.cpp @@ -62,6 +62,7 @@ getUrEvents(const std::vector &DepEvents) { return RetUrEvents; } +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES template <> uint32_t queue_impl::get_info() const { ur_result_t result = UR_RESULT_SUCCESS; @@ -69,6 +70,7 @@ uint32_t queue_impl::get_info() const { MQueue, UR_QUEUE_INFO_REFERENCE_COUNT, sizeof(result), &result, nullptr); return result; } +#endif // __INTEL_PREVIEW_BREAKING_CHANGES template <> context queue_impl::get_info() const { return get_context(); diff --git a/sycl/source/device.cpp b/sycl/source/device.cpp index 9545cbb4a5a04..9209c77dbb336 100644 --- a/sycl/source/device.cpp +++ b/sycl/source/device.cpp @@ -282,7 +282,9 @@ __SYCL_DEVICE_INFO_INST(partition_type_affinity_domain, #ifndef __INTEL_PREVIEW_BREAKING_CHANGES __SYCL_DEVICE_INFO_INST(atomic64, bool) #endif // __INTEL_PREVIEW_BREAKING_CHANGES +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES __SYCL_DEVICE_INFO_INST(reference_count, uint32_t) +#endif // __INTEL_PREVIEW_BREAKING_CHANGES __SYCL_DEVICE_INFO_INST(usm_device_allocations, bool) __SYCL_DEVICE_INFO_INST(usm_host_allocations, bool) __SYCL_DEVICE_INFO_INST(usm_shared_allocations, bool) diff --git a/sycl/source/event.cpp b/sycl/source/event.cpp index 48611dfbdb456..246cd6b92dc52 100644 --- a/sycl/source/event.cpp +++ b/sycl/source/event.cpp @@ -94,7 +94,9 @@ event::get_profiling_info() const { #define __SYCL_EVENT_INFO_INST(NAME, RETURN_T) \ template __SYCL_EXPORT RETURN_T event::get_info() const; __SYCL_EVENT_INFO_INST(command_execution_status, info::event_command_status) +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES __SYCL_EVENT_INFO_INST(reference_count, uint32_t) +#endif // __INTEL_PREVIEW_BREAKING_CHANGES #undef __SYCL_EVENT_INFO_INST #define __SYCL_EVENT_PROFILING_INFO_INST(NAME, RETURN_T) \ diff --git a/sycl/source/kernel.cpp b/sycl/source/kernel.cpp index 8abde164c6b62..ad8a168c262d5 100644 --- a/sycl/source/kernel.cpp +++ b/sycl/source/kernel.cpp @@ -62,7 +62,9 @@ kernel::get_info_impl() const { __SYCL_KERNEL_INFO_INST(num_args, uint32_t) __SYCL_KERNEL_INFO_INST(attributes, std::string) __SYCL_KERNEL_INFO_INST(function_name, std::string) +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES __SYCL_KERNEL_INFO_INST(reference_count, uint32_t) +#endif // __INTEL_PREVIEW_BREAKING_CHANGES __SYCL_KERNEL_INFO_INST(context, sycl::context) #undef __SYCL_KERNEL_INFO_INST diff --git a/sycl/source/queue.cpp b/sycl/source/queue.cpp index 4e57c36d4ef99..4e5b4b13becc7 100644 --- a/sycl/source/queue.cpp +++ b/sycl/source/queue.cpp @@ -228,7 +228,9 @@ queue::get_info() const { template __SYCL_EXPORT RETURN_T queue::get_info() const; __SYCL_QUEUE_INFO_INST(context, sycl::context) __SYCL_QUEUE_INFO_INST(device, sycl::device) +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES __SYCL_QUEUE_INFO_INST(reference_count, uint32_t) +#endif // __INTEL_PREVIEW_BREAKING_CHANGES #undef __SYCL_QUEUE_INFO_INST template diff --git a/sycl/test-e2e/Basic/info.cpp b/sycl/test-e2e/Basic/info.cpp index dd849b749ccfe..abdb57c1b29b3 100644 --- a/sycl/test-e2e/Basic/info.cpp +++ b/sycl/test-e2e/Basic/info.cpp @@ -386,8 +386,6 @@ int main() { print_info(dev, "Partition type affinity domain"); - print_info( - dev, "Reference count"); std::cout << separator << "Platform information\n" << separator; platform plt(dev.get_platform()); diff --git a/sycl/test-e2e/Basic/kernel_info.cpp b/sycl/test-e2e/Basic/kernel_info.cpp index 95215356c6383..bf42dbb29bba3 100644 --- a/sycl/test-e2e/Basic/kernel_info.cpp +++ b/sycl/test-e2e/Basic/kernel_info.cpp @@ -71,18 +71,11 @@ int main() { const context krnCtx = krn.get_info(); assert(krnCtx == q.get_context()); - const cl_uint krnRefCount = krn.get_info(); - assert(krnRefCount > 0); // Use ext_oneapi_get_kernel_info extension and check that answers match. const context krnCtxExt = syclex::get_kernel_info(ctx); assert(krnCtxExt == krnCtx); - // Reference count might be different because we have to retain the kernel - // handle first to fetch the info. So just check that it is not 0. - const cl_uint krnRefCountExt = - syclex::get_kernel_info(ctx); - assert(krnRefCountExt > 0); device dev = q.get_device(); const size_t wgSize = diff --git a/sycl/test-e2e/Regression/dummy_event_info.cpp b/sycl/test-e2e/Regression/dummy_event_info.cpp index 58a721629e4e0..b106810bb3d51 100644 --- a/sycl/test-e2e/Regression/dummy_event_info.cpp +++ b/sycl/test-e2e/Regression/dummy_event_info.cpp @@ -18,7 +18,6 @@ int main() { assert(e.get_info() == info::event_command_status::complete); - assert(e.get_info() == 0); auto submit_time = e.get_profiling_info(); auto start_time = diff --git a/sycl/test/warnings/sycl_2020_deprecations.cpp b/sycl/test/warnings/sycl_2020_deprecations.cpp index 30b41ea194772..238728e60e5eb 100644 --- a/sycl/test/warnings/sycl_2020_deprecations.cpp +++ b/sycl/test/warnings/sycl_2020_deprecations.cpp @@ -138,6 +138,17 @@ int main() { // expected-warning@+1{{'extensions' is deprecated: deprecated in SYCL 2020, use device::get_info() with info::device::aspects instead}} using PE = sycl::info::platform::extensions; + // expected-warning@+1{{'reference_count' is deprecated: info::context::reference_count is not part of SYCL 2020}} + using CRC = sycl::info::context::reference_count; + // expected-warning@+1{{'reference_count' is deprecated: info::device::reference_count is not part of SYCL 2020}} + using DRC = sycl::info::device::reference_count; + // expected-warning@+1{{'reference_count' is deprecated: info::event::reference_count is not part of SYCL 2020}} + using ERC = sycl::info::event::reference_count; + // expected-warning@+1{{'reference_count' is deprecated: info::kernel::reference_count is not part of SYCL 2020}} + using KRC = sycl::info::kernel::reference_count; + // expected-warning@+1{{'reference_count' is deprecated: info::queue::reference_count is not part of SYCL 2020}} + using QRC = sycl::info::queue::reference_count; + // expected-error@+1{{no member named 'INTEL' in namespace 'sycl'}} auto SL = sycl::INTEL::source_language::opencl_c; (void)SL;