alpaka-group / alpaka

Abstraction Library for Parallel Kernel Acceleration :llama:
https://alpaka.readthedocs.io
Mozilla Public License 2.0
337 stars 69 forks source link

[Wip] Add an overload to exec function [III] #2262

Closed mehmetyusufoglu closed 1 month ago

mehmetyusufoglu commented 2 months ago

This PR will be merged after #2261 Includes changes of 2 previously created PRs.

exec function of the API currently accept kernel object and it's arguments as separate arguments. This current function is not changed but a new overload is added: only one single argument (i.e bundeledKernel) for the kernel and arguments is passed instead of kernel function object and it's arguments.

CreateTaskKernel function is changed similarly, accepts a single kernelBundle not kernel function object and arguments. (That not an overload, function itself is changed).

auto const& bundeledKernel = alpaka::makeKernelBundle<DevAcc>(
        kernel,
        kernelInput1,
        kernelInput2,
        kernelInput3);

// give kernel as a single argument, because mixing up arguments was possible, was not a proper design 
  alpaka::exec<DevAcc>(
        queue,
        workDiv, bundeledKernel
        //kernel,
        //kernelInput1,
       // kernelInput2, 
        // kernelInput3
       );