Skip to content

[SYCL] Deprecate info::*::reference_count#22521

Draft
crystarm wants to merge 3 commits into
intel:syclfrom
crystarm:deprecate-info-reference-count
Draft

[SYCL] Deprecate info::*::reference_count#22521
crystarm wants to merge 3 commits into
intel:syclfrom
crystarm:deprecate-info-reference-count

Conversation

@crystarm

@crystarm crystarm commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Fixes #22504.

Summary

info::reference_count descriptors exist in five info namespaces (context, device, event, kernel, queue).

This PR deprecates all five descriptors and guards them behind __INTEL_PREVIEW_BREAKING_CHANGES.

Notes

Three e2e tests (Basic/kernel_info.cpp, Basic/info.cpp, Regression/dummy_event_info.cpp) still reference reference_count and will emit deprecation warnings. I guess they should be cleaned up in a follow-up.

@crystarm crystarm requested a review from a team as a code owner July 2, 2026 11:53
@crystarm crystarm requested a review from uditagarwal97 July 2, 2026 11:53
@crystarm crystarm marked this pull request as draft July 2, 2026 11:57
@crystarm crystarm marked this pull request as ready for review July 2, 2026 12:24
@uditagarwal97 uditagarwal97 requested a review from Copilot July 2, 2026 15:35

@uditagarwal97 uditagarwal97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR deprecates the legacy SYCL 1.2.1 info::*::reference_count descriptors (not part of SYCL 2020) across the context, device, event, kernel, and queue info namespaces, and gates their availability behind __INTEL_PREVIEW_BREAKING_CHANGES for future removal during an ABI-break window.

Changes:

  • Adds __SYCL_DEPRECATED annotations to info::{context,device,event,kernel,queue}::reference_count.
  • Wraps the corresponding explicit template instantiations and get_info specializations in #ifndef __INTEL_PREVIEW_BREAKING_CHANGES.
  • Ensures the public info descriptors themselves are also conditionally available under the same macro.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
sycl/source/queue.cpp Gates queue::get_info<info::queue::reference_count>() explicit instantiation behind __INTEL_PREVIEW_BREAKING_CHANGES.
sycl/source/kernel.cpp Gates kernel::get_info_impl<info::kernel::reference_count>() explicit instantiation behind __INTEL_PREVIEW_BREAKING_CHANGES.
sycl/source/event.cpp Gates event::get_info<info::event::reference_count>() explicit instantiation behind __INTEL_PREVIEW_BREAKING_CHANGES.
sycl/source/device.cpp Gates device::get_info_impl<info::device::reference_count>() explicit instantiation behind __INTEL_PREVIEW_BREAKING_CHANGES.
sycl/source/context.cpp Gates context::get_info<info::context::reference_count>() explicit instantiation behind __INTEL_PREVIEW_BREAKING_CHANGES.
sycl/source/detail/queue_impl.cpp Gates the queue_impl reference_count query specialization behind __INTEL_PREVIEW_BREAKING_CHANGES.
sycl/source/detail/event_impl.cpp Gates the event_impl reference_count query specialization behind __INTEL_PREVIEW_BREAKING_CHANGES.
sycl/source/detail/context_impl.cpp Gates the context_impl reference_count query specialization behind __INTEL_PREVIEW_BREAKING_CHANGES.
sycl/include/sycl/info/queue.hpp Deprecates and gates info::queue::reference_count.
sycl/include/sycl/info/kernel.hpp Deprecates and gates info::kernel::reference_count.
sycl/include/sycl/info/event.hpp Deprecates and gates info::event::reference_count.
sycl/include/sycl/info/device.hpp Deprecates and gates info::device::reference_count.
sycl/include/sycl/info/context.hpp Deprecates and gates info::context::reference_count.

Comment on lines 68 to 71
ur_result_t result = UR_RESULT_SUCCESS;
getAdapter().call<UrApiKind::urQueueGetInfo>(
MQueue, UR_QUEUE_INFO_REFERENCE_COUNT, sizeof(result), &result, nullptr);
return result;
Comment on lines +42 to 46
struct __SYCL_DEPRECATED("info::kernel::reference_count is not part of "
"SYCL 2020") reference_count
: kernel_traits<UR_KERNEL_INFO_REFERENCE_COUNT> {
using return_type = uint32_t;
};
Comment on lines +40 to 44
struct __SYCL_DEPRECATED("info::event::reference_count is not part of "
"SYCL 2020") reference_count
: event_traits<UR_EVENT_INFO_REFERENCE_COUNT> {
using return_type = uint32_t;
};
@KornevNikita

Copy link
Copy Markdown
Contributor

@crystarm please fix pre-commit issues

@crystarm crystarm marked this pull request as draft July 3, 2026 12:53

@KornevNikita KornevNikita left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, @uditagarwal97 could you please take one more look


#pragma once

#include <sycl/detail/defines_elementary.hpp>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's guard this include here and in other files so that we don't forget to remove it.

print_info<info::device::partition_type_affinity_domain,
info::partition_affinity_domain>(dev,
"Partition type affinity domain");
print_info<info::device::reference_count, sycl::opencl::cl_uint>(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests also can be guarded with #ifdef __INTEL_PREVIEW_BREAKING_CHANGES, although I'm okay with just removing this, up to @uditagarwal97

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also okay with just removing this.

@@ -0,0 +1,47 @@
// UNSUPPORTED: preview-mode
// UNSUPPORTED-INTENDED: reference_count is unavailable in preview mode.
// RUN: %{build} -o %t.out

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would -fsyntax-only suffice here? since we are not running the test anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove undocumented info::reference_count

4 participants