triSYCL icon indicating copy to clipboard operation
triSYCL copied to clipboard

Experiment with ISO C++ P1393R0: A General Property Customization Mechanism

Open keryell opened this issue 6 years ago • 7 comments

I was stunned by the presentation from David Hollman at the last ISO C++ meeting about how to manage properties in the context of the executor mechanism http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1393r0.html It is actually a very generic framework to create some objects with some properties, such as creating some new kernel with some execution restrictions, some buffers with some storage details or whatever. For example std::require(E, P0, P1, P3) will return some object from expression E with the properties P0, P1 and P2 added. It looks like we could experiment how we can use this mechanism to add and query some properties in SYCL, for example setting the work-group size of a kernel.

keryell avatar Mar 26 '19 19:03 keryell

Is the presentation available publicly? And/Or some demo of its usage?

MathiasMagnus avatar Apr 01 '19 12:04 MathiasMagnus

@dhollman : is your presentation publicly accessible somewhere?

keryell avatar Apr 03 '19 04:04 keryell

https://gitpitch.com/dhollman/p1393-kona-private

Let me know if you have any questions or need any help! @chriskohlhoff has written a version of the library support part of this and made it public. It's called propria. I believe we still slightly differ in opinion/interpretation on a couple of small things, but it should be sufficient for most purposes.

dhollman avatar Apr 03 '19 20:04 dhollman

Actually, I read through @chriskohlhoff's code, and I think we're on the same page on everything that's in there. At one point there was some difference of opinion on how adapters should work, but that's not in his library and I think we are on the same page on that now anyway.

dhollman avatar Apr 03 '19 20:04 dhollman

Thank you for the slides! Nice there is also some implementation of this.

keryell avatar Apr 03 '19 20:04 keryell

@keryell Would you mind expanding a little on your ideas for using properties with buffers and 'storage details or whatever'? I plan to add some example programs to propria and want to base them on real-world use cases that are hopefully not too domain-specific (and also not related to executors). Buffers sound like they could be a good candidate.

chriskohlhoff avatar Apr 03 '19 21:04 chriskohlhoff

@chriskohlhoff In SYCL we focus on heterogeneous computing, where we do not have a uniform memory model following the standard C++ one. So typically you want some buffers to be allocated specifically on some special memories or registers, with some time or space locality hints, etc.

The problem is that it is domain-specific so I do not know how we can extract this as a good example for you... Actually time & space locality, mostly-read or mostly-write, discard-write properties seem interesting at large outside of SYCL, so you could build a trivial example with such properties.

For some wild ideas about properties, you could also look at https://github.com/keryell/accessors

This is already 3 year old, so you can imagine that now we need even more something like properties (and something like SYCL in ISO C++ ;-) ).

keryell avatar Apr 05 '19 15:04 keryell