Closed mehmetyusufoglu closed 8 months ago
@mehmetyusufoglu these changes are not equivalent:
alpaka::exec<Acc>(queue, ...);
is equivalent to task = alpaka::createTaskKernel<Acc>(...); alpaka::enqueue(queue, task);
alpaka::wait(queue);
is needed in either case, if one wants to wait for the kernel execution to complete.That said, why do you want to migrate back from exec
to createTaskKernel + enqueue
?
I'd rather always use exec
and avoid the explicit creation of the temporary task.
@mehmetyusufoglu these changes are not equivalent:
* `alpaka::exec<Acc>(queue, ...);` is equivalent to `task = alpaka::createTaskKernel<Acc>(...); alpaka::enqueue(queue, task);` * the call to `alpaka::wait(queue);` is needed in either case, if one wants to wait for the kernel execution to complete.
That said, why do you want to migrate back from
exec
tocreateTaskKernel + enqueue
? I'd rather always useexec
and avoid the explicit creation of the temporary task.
.
@mehmetyusufoglu these changes are not equivalent:
* `alpaka::exec<Acc>(queue, ...);` is equivalent to `task = alpaka::createTaskKernel<Acc>(...); alpaka::enqueue(queue, task);` * the call to `alpaka::wait(queue);` is needed in either case, if one wants to wait for the kernel execution to complete.
That said, why do you want to migrate back from
exec
tocreateTaskKernel + enqueue
? I'd rather always useexec
and avoid the explicit creation of the temporary task.
These changes are requested by Rene while we were talking about "why there are 2 different ways of calling kernels in examples". This is WIP, to be discussed. I can close the pull request if it is not needed.
About wait()
, yes, I was doubted about it certainly. Thanks.
Closed, not needed currently.
@mehmetyusufoglu these changes are not equivalent:
alpaka::exec<Acc>(queue, ...);
is equivalent totask = alpaka::createTaskKernel<Acc>(...); alpaka::enqueue(queue, task);
- the call to
alpaka::wait(queue);
is needed in either case, if one wants to wait for the kernel execution to complete.That said, why do you want to migrate back from
exec
tocreateTaskKernel + enqueue
? I'd rather always useexec
and avoid the explicit creation of the temporary task.
@fwyzard Independent of the wrong removed waits. I am wondering if it makes more sense to remove alpaka::exec<Acc>()
and provide alpaka::enqueue<Acc>(queue, workdiv, kernel)
or alpaka::enqueue(alpaka::TagGpuCudaRt, queue, workdiv, kernel)
?
I do not see a real reason why we have two different naming to enqueue an kernel. That we have different function signatures makes IMO sense.
There are 2 ways of running a kernel. Some of the examples use
alpaka::exec<Acc>(queue, workdiv...) + wait(queue)
some others usecreateTaskKernel<Acc> and enqueue
functions.All of the exec and wait function call pairs converted to
createTaskKernel + enqueue
calls.Tests All example results are the same as before these changes.
Clarification Needed:
If there is a function call between
exec
call andwait
call, how the change above could be done? See the change in MonteCarlo example.Note from @psychocoderHPC : I checked the code. And enqueue requires that we bind together already the kernel with the work division. Where exec allows to pass the work division and kernel separate more similar to how CUDA works. I like the exec way more because very often the kernel will be started with different work division size. IN that case the user must always call
for any new block and grid configuration. So the user code becomes longer. IMO we should provide additionally an enqueue which has the same signature as exec has and provide two interfaces of enqueue. Let us have a short discussion in the next developer meeting.