Skip to content

First draft of a KHR for properties#980

Draft
gmlueck wants to merge 2 commits intoKhronosGroup:mainfrom
gmlueck:me/khr-properties
Draft

First draft of a KHR for properties#980
gmlueck wants to merge 2 commits intoKhronosGroup:mainfrom
gmlueck:me/khr-properties

Conversation

@gmlueck
Copy link
Contributor

@gmlueck gmlueck commented Feb 25, 2026

This is a WIP draft KHR for compile-time properties. The text of the KHR is not complete yet, and there are still some open issues, but I think it's far enough along to start getting feedback.

The open issues at the bottom refer to "the POC". This is a POC implementation of this KHR which I wrote only to flesh out ideas. For those who are interested, the POC is available at intel/llvm#21368.

It seems to make sense to allow a property with a runtime-supplied value
to be constexpr when the property value is a constant, at least for
those properties whose values could potentially be constants.  This is
not the same as a compile-time constant property, though, because the
type of the property still does not convey the value of the property.

Likewise, it seems to make sense to add `constexpr` to the `properties`
constructor, so that a `properties` can be declared as a constant when
all of its properties are constant expressions.
keryell added a commit to SYCL/properties that referenced this pull request Mar 11, 2026
Minimal C++20 header-only implementation of the compile-time properties
extension: properties class with CTAD, 6 traits, support for runtime,
compile-time and hybrid property kinds, plus queue properties and tests.

My question was:

I would like to create a minimal C++20 implementation for
KhronosGroup/SYCL-Docs#980. You can start by gathering
the C++ pieces found in the AsciiDoctor document and summarize it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@keryell
Copy link
Member

keryell commented Mar 11, 2026

I have made an implementation of this with 5 variations with the help of Claude Code CLI Opus 4.6 1M tokens: https://github.com/SYCL/properties

So it looks like using prop2<> as a key works for constexpr properties. @illuhad

@keryell
Copy link
Member

keryell commented Mar 12, 2026

Some other ideas on clean interface https://github.com/qlibs/mp

@VerenaBeckham
Copy link
Contributor

I love the idea of compile-time properties, but does Intel have a killer use-case for them right now? As I understand it, all the existing SYCL properties would remain "runtime properties" as described by this KHR. Also, in the "free function commands KHR", which now depends on this KHR, I can't immediately see a property that would be implemented as a compile-time property, unless I missed it?
Is there a compile-time property that you are intending to introduce once this KHR is merged?

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.

3 participants