-
Notifications
You must be signed in to change notification settings - Fork 69
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
base: main
Are you sure you want to change the base?
Conversation
Previously, the description of information descriptors was spread out across multiple sections and appendices. This commit introduces a new section and a glossary entry to more clearly explain the concept of an information descriptor prior to detailing the behavior of each SYCL class.
Always nice to tiding up!
This is a stupid remark, but should we remove the other text that has now been consolidated in the new section? |
I did consider this, but I'd rather leave this to a later PR. I wasn't really sure how far to go with it. I like the way that @gmlueck reformatted the description of the various aspects, and I think it probably makes sense to do something similar with information descriptors. But removing the information descriptor appendix and cleaning up those tables seemed like a huge change. |
Work for me! |
---- | ||
class __InformationDescriptor__ | ||
{ | ||
public: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for doing this @Pennycook.
I think it's a very good readability improvement. :)
Co-authored-by: Nuno Nobre <[email protected]>
I'm not wild about this change for a few reasons:
I agree with @nmnobre that the old format we had in the SYCL specification made the structure of information descriptors non-obvious, just as he says in #407. However, I think the new format fixes this because it shows the exact definition of each information descriptor. We use this format for most of the classes that use information descriptors ( The only classes with information descriptors that don't follow the new format are |
Ah! This is awesome, I wasn't aware of this reformat! For clarity, you're talking about #567, #587, #601, #606 (and their cherry-picks to The only caveat is if we don't change |
I was following the precedent of set by Section 4.5.2, Section 4.5.3 and Section 4.5.4, all of which describe a general pattern that other classes follow and provide a list of classes. Are you suggesting that we get rid of these sections too? I think there is value in providing a high-level overview of why commonality may exist in an interface like this. I agree with you that showing the actual interface and listing the classes is probably unnecessary, but I'd like us to be consistent. To clarify: I'm not opposed to taking the interface and class list out of this PR, leaving only the introduction to the concept of an information descriptor and the glossary entry. But if we do that, I think it would make sense to define all of the operators available in SYCL runtime classes explicitly, instead of just saying something like "This class has common reference semantics."
I agree we should remove the appendix. I can remove the references to the appendix, to make that easier.
I agree we should do this. |
Yes.
Correct.
We can keep #729 if you want. The changes it makes to Appendix A are valid. I hope to remove Appendix A at some point, but it might not happen for rev 10.
I don't mind keeping #729. It only changes Appendix A, and it's easy to remove all of Appendix A later. I'm not wild about the changes here in #725 because it adds more stuff to the rest of the spec that we'd need to remove later.
I think those sections are different. They do more than just explain a code pattern. They are the normative description of the "common reference semantics" member functions, etc. For example, the I'm not sure what the right thing to do here is yet. I think it might be more clear to explicitly list all the common reference semantics member functions, and then have a description that says something like:
where section XX defines the common reference semantics. I don't think we need to do this for
If you remove the interface and the class list, what would remain in the section "Information queries"? I'd like to avoid listing all the classes that define |
I agree that this would be clearer. The first time I read the SYCL specification, I thought the comment that says "Common member functions" was a header for the functions beneath it, rather than a substitute for some function definitions.
I've pushed a change in c31cfca to show what this could look like. As you say, it does end up being quite a small section. But I still think there's some value in highlighting somewhere that there's a single |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple comments on this one. Feel free to merge this when you think it's ready.
This is probably my last review for a while as I have finally finished my travels and have arrived in New Zealand!
==== Information query interface | ||
|
||
The information query interface consists of a [code]#get_info()# function | ||
template, which is templated on an <<information-descriptor>>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't entirely true because there is also get_backend_info
, which also takes an information descriptor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! I always forget about this backend-specific stuff. I've added references to backends in 2aa55a0.
adoc/chapters/glossary.adoc
Outdated
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#. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the return type std::string
? Just because a "name" would normally be a string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, exactly.
I've tried to reword this glossary entry in b70832f to avoid this issue: instead of saying that it "would" return a std::string
just because it's called "name", I've flipped it to say that if a descriptor was called "name" and had a return type defined to be std::string
, the information query should be expected to return the entity's name as a string.
Both of these functions could be considered part of the information query interface, so should be documented together.
The previous wording did not clearly explain why a "name" descriptor would return a string. The new wording makes the fact that the example descriptor returns a string part of its definition, instead.
Saying the name "is" an arbitrary string suggests the name is meaningless.
Previously, the description of information descriptors was spread out across multiple sections and appendices. This commit introduces a new section and a glossary entry to more clearly explain the concept of an information descriptor prior to detailing the behavior of each SYCL class.
Closes #410. Addresses feedback originally raised by @nmnobre in #407.
I deliberately added this to the end of the "Common interface" section so that it wouldn't affect renumbering, should we choose to cherry-pick it to SYCL 2020.