Open dhollman opened 6 years ago
Example usage added in this commit of the darma-examples repository
@giulioborghesi How likely are you to be able to do this one? Since I'll be focussing on the simple backend for ECP, it would be nice if this were something you could do. The example usage in the apps/jacobi_2d/jacobi_oo
directory of the DARMA examples repository should serve as a guide for what needs to work.
I will have a look at this. I think I should be able to do it
This would be expressed via
required_permissions
orpermissions_downgrades
static methods of the user-defined functor that take the same arguments as the Functor's call operator, except that no automatic dereferencing would occur and static permissions downgrades implied by the parameter's type (e.g.,ReadAccessHandle<T>
) are not required to match. (Thecreate_concurrent_work
analog of this would have some differences; we can put that in a separate issue). For instance,The specification of the two static method options should be mutually exclusive:
required_permissions
should assume no permissions and add in the returned permissions, whilepermissions_downgrades
should express downgrades of the permissions implied by the call operator parameters.The
required_permissions
andpermissions_downgrades
methods should return, respectively, the result of a call to variadic free function templates nameddarma::required_permissions
anddarma::permissions_downgrades
(which, in turn, return an unspecified type withshared_ptr
-like semantics). These function templates would take the same order-independent arguments as can be given to a lambda-stylecreate_work
to expresspermissions_downgrades
(with the extension that we'd have to have some new ones likemodifies
to express permissions upgrades). Example:Some potential challenges:
AccessHandle
argument or a plain-old value argument), what should the argument topermissions_downgrades
be (or the parameter, for that matter)? Should DARMA generate anAccessHandle
(maybe a special one) to pass to the permissions function?create_work
(though I think we'll still need to go over the details ofdetail::functor_traits
pretty carefully), but not forcreate_concurrent_work