Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[SYCL] Use custom type to pass CGF around instead of
std::function
#16668[SYCL] Use custom type to pass CGF around instead of
std::function
#16668Changes from 1 commit
2995102
d6a9f58
8b4a040
a5e5097
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
@gmlueck , is this true?
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.
In general, a member function pointer cannot be called via
operator()
because the compiler needs to also have a pointer to the object. The syntax for calling through a member functionpmem
isobj.*pmem()
, which is different fromoperator()
. Is that your question?I think the spec would technically allow the command group function object to be a plain function pointer or a plain (non-member) function because these can be called via
operator()
. However, this seems of limited use because you wouldn't be able to capture any local variables, so it would be difficult, for example, to pass parameters to the kernel. I suppose it might make sense if you were enqueuing a kernel that didn't take any parameters. Or, you could store the kernel parameter values in a global variable, and read the variable from the function (yuck!).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.
When I first saw this I was wondering if we could use
std::invokable
instead, but I think that'd change the ABI, plus it might have the same too-much-templating problem asstd::function
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 don't see how it's applicable here.
std::invokable
is a concept, not a data type; so more likestd::is_invokable_r
trait that we are already using.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.
@steffenlarsen , any idea if
llvm/sycl/include/sycl/queue.hpp
Lines 792 to 793 in a87ac06
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.
The "fallback kernel" in this case is not referring to fallback asserts. It's because the implementation of
ext_oneapi_memcpy2d
has a kernel it uses if the operation isn't natively supported, but we don't want that kernel to pop up unless the user callsext_oneapi_memcpy2d
in their code, so we make it dependent.