Navigation Menu

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

Clarify the meaning of (optional) core extension #500

Open
AnastasiaStulova opened this issue Nov 23, 2020 · 4 comments
Open

Clarify the meaning of (optional) core extension #500

AnastasiaStulova opened this issue Nov 23, 2020 · 4 comments
Assignees
Labels
OpenCL C Spec Issues related to the OpenCL C Language specification.

Comments

@AnastasiaStulova
Copy link
Contributor

AnastasiaStulova commented Nov 23, 2020

OpenCL C 3.0 spec has section 6.2 where features and extensions are described however OpenCL has and will probably still have core and optional core extensions. It would be good to add a clear definition regarding those and differences between those.

@AnastasiaStulova AnastasiaStulova added the OpenCL C Spec Issues related to the OpenCL C Language specification. label Nov 23, 2020
@AnastasiaStulova
Copy link
Contributor Author

After discussion on OpenCL WG teleconference today, it feels to me that the majority of extensions that migrated into features have exactly the functionality of features described in OpenCL C 3.0 spec section 6.2. FYI if an extension had a pragma its use has no effect (neither when it's disabled or enabled) in the language versions where this extension has become a feature (optional or not). @bashbaug could I double-check this with you please?

FYI the references to features in OpenCL C 2.0 are as follows

Double precision floating-point is an optional feature.

And in the extension spec it has:

The functionality previously described by cl_khr_byte_addressable_store is now part of the
core feature set.

So we used to have:

  • optional core features that are mostly equivalent to OpenCL C 3.0 feature definition. Except for pragma.
  • core features that are different to other OpenCL C 3.0 features because they are non-optional i.e. every device needs to support those starting from the version it becomes core.

In OpenCL 3.0 extension spec we still have sections in Appendix A where we list core features but however, we never describe what they are or at least explain that they are not to be confused with feature definition in the section 6.2, so there is still some work to be done for clarifying the features.

@bashbaug
Copy link
Contributor

bashbaug commented Dec 2, 2020

Sorry for the slow reply, I'm still catching up after the US thanksgiving holidays.

could I double-check this with you please?

Yes, I think this sounds right. The way I think about it is:

  • An extension is an optional feature that is described in an extension spec. It is not described in the core spec because it "extends" the core spec. When an extension extends OpenCL C it will have an extension define and it may have an extension pragma.

  • Core features are described in the core spec. A core feature may be required for all conformant implementations (e.g. integer arithmetic is required for all OpenCL devices), or it may be optional for some implementations (e.g. double-precision arithmetic). When a core feature is optional in OpenCL C it will have a feature test macro, but it will never have a pragma - at least so far, all optional core features are unconditionally enabled.

  • If an feature began as an extension before becoming an optional core feature (e.g. double-precision) then it may have a feature test macro, an extension define, and an extension pragma, but the extension pragma is irrelevant since an optional core feature is always enabled and cannot be disabled.

I'm open to suggestions to improve the OpenCL extension spec Appendix A. Are you looking for definitions of the terms (similar to this comment!) or something different?

@bashbaug
Copy link
Contributor

bashbaug commented Dec 3, 2020

Discussed in the December 3rd tooling TSG. We will add a clarification to the OpenCL C spec, probably in Section 6.2.

@AnastasiaStulova
Copy link
Contributor Author

AnastasiaStulova commented Dec 15, 2020

Keeping this issue open until we clarify:

  • extension macro for non-optional core features
  • extension pragma for optional and non-optional core features

See #523 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OpenCL C Spec Issues related to the OpenCL C Language specification.
Development

No branches or pull requests

2 participants