Skip to content

kernel argument setup #261

Answered by linehill
pvelesko asked this question in Q&A
Nov 22, 2022 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

What is the purpose of making these local copies instead of using arguments directly?

I got the kernel launch stub a bit wrong. More accurately it looks like this:

void __device_stub__simpleKernel(float *arg0, float *arg1) {
  void *Args[2] = {&arg0, &arg1};
  hipLaunchKernel(..., Args, ...);
}

Even with these local pointers, I should be able to de-reference them to get the original addresses that were passed to the kernel invocation, no?

Yes, they can be dereferenced, but until to the point the caller returns from the stub, and you do get to access the arguments of the kernel invocation in the state they are passed to the invocation.

I’m starting to see that I misread the original “…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@pvelesko
Comment options

pvelesko Nov 22, 2022
Maintainer Author

Comment options

You must be logged in to vote
0 replies
Answer selected by pvelesko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants