-
Notifications
You must be signed in to change notification settings - Fork 115
WIP: Custom backends for Dynamic Selection #2220
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
base: main
Are you sure you want to change the base?
Conversation
The `get_submission_group` is not easily implemented in a meaningful way. It must return a type that | ||
defines a member function `wait`. But since there is no way to know how to wait on all previous submissions | ||
for an arbitrary backend resource, this function will likely need to return a dummy type or | ||
`get_submission_group` be undefined for the default backend. |
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.
If we could provide a way to have the user give us the wait type, do we have a shot? Or maybe it's better to leave this out to make the default case simple.
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.
Lets consider if there's a meaningful default or not. I'm not sure that there is.
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 a meaningful default is to call wait on all resources, if they have a wait function.
Policies contain a backend and current policies are either default constructed/initialized or | ||
constructed/initialized with a `std::vector<Resouce>` of resources. When a vector is passed | ||
to the constructor, the type of the resource can be deduced and used as a template argument | ||
when constructing the backend. When a policy is default constructed, the resource type can be made | ||
a manditory template argument and this can be used to set the resource type in the backend. |
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.
Should include deferred initialization here.
when constructing the backend. When a policy is default constructed, the resource type can be made | ||
a manditory template argument and this can be used to set the resource type in the backend. | ||
|
||
Is it therefore becomes unnecessary to explicitly provide the resource type in the default backend. |
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.
Is it therefore becomes unnecessary to explicitly provide the resource type in the default backend. | |
It therefore becomes unnecessary to explicitly provide the resource type in the default backend. |
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.
Also, we probably want to soften the language here a bit to accomodate the default constructor and deferred initialization constructors.
Perhaps we can just add on "when providing resource objects to a constructor." or something like that.
|
||
// v is empty | ||
auto v = p.get_resources(); | ||
``` |
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.
mention deferred initialization.
Co-authored-by: Dan Hoeflinger <109972525+danhoeflinger@users.noreply.github.com>
Co-authored-by: Dan Hoeflinger <109972525+danhoeflinger@users.noreply.github.com>
Co-authored-by: Dan Hoeflinger <109972525+danhoeflinger@users.noreply.github.com>
Co-authored-by: Dan Hoeflinger <109972525+danhoeflinger@users.noreply.github.com>
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 this looks pretty good. Mostly just quite minor changes for now.
namespace experimental { | ||
|
||
template <typename ResourceType> | ||
struct backend_for_resource |
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 know this is my naming, but I don't like it, perhaps it should just be resource_traits
, perhaps backend_t
should be default_backend_t
?
resource_traits<resource_t>::default_backend_t
Co-authored-by: Dan Hoeflinger <109972525+danhoeflinger@users.noreply.github.com>
Co-authored-by: Dan Hoeflinger <109972525+danhoeflinger@users.noreply.github.com>
Co-authored-by: Dan Hoeflinger <109972525+danhoeflinger@users.noreply.github.com>
Co-authored-by: Dan Hoeflinger <109972525+danhoeflinger@users.noreply.github.com>
Co-authored-by: Dan Hoeflinger <109972525+danhoeflinger@users.noreply.github.com>
A very rough draft for custom backends for dynamic selection.