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

Improve description of information descriptors #725

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
9 changes: 9 additions & 0 deletions adoc/chapters/glossary.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,15 @@ For the full description please refer to <<subsec:buffers>>.
* [code]#sycl::group# : The <<group>> class that contains the
<<work-group-id>> and the member functions on a <<work-group>>.

[[information-descriptor]]information descriptor::
A class encapsulating an information query and its return type.
For example, an information descriptor called
[code]#sycl::info::class::name# would describe a query for the name of the
entity represented by that class, and would define a return type of
[code]#std::string#.
A full list of information descriptors for various SYCL classes can be found
in <<sec:information-descriptors>>.

[[input]]input::
A state which a <<kernel-bundle>> can be in, representing
<<sycl-kernel-function,SYCL kernel functions>> as a source or intermediate
Expand Down
34 changes: 34 additions & 0 deletions adoc/chapters/programming_interface.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,40 @@ Construct a SYCL [code]#property_list# with zero or more properties.

|====

=== Information queries

Each of the following classes provides a generic mechanism for querying the
class for information: [code]#context#, [code]#device#, [code]#event#,
[code]#kernel#, [code]#platform#, and [code]#queue#.

Each available query is described by an <<information-descriptor>>, which is is
a class or class template implementing the interface below:

[source]
----
class __InformationDescriptor__
{
public:
Copy link
Contributor

@TApplencourt TApplencourt Feb 14, 2025

Choose a reason for hiding this comment

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

I think the other part of the spec indent has 2 space, but that ok. Need to make a PR to format all the [source] with clang format, so will be fixed then.

using return_type = /* return type for this information query */;
};
----

==== Information query interface

The information query interface consists of a [code]#get_info()# function
template, which is templated on an <<information-descriptor>>.

[source,role=synopsis]
----
template <typename Param>
typename Param::return_type get_info() const;
----

_Constraints_: [code]#Param# must be an <<information-descriptor>> compatible
with the class, as listed in <<sec:information-descriptors>>.

_Returns_: The information corresponding to [code]#Param# in the table of
information descriptors associated with the class.


== SYCL runtime classes
Expand Down