Skip to content
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

Create utility functions for launching kernels similar to CUDA and HIP backends. #40

Open
2 tasks
kris-rowe opened this issue Mar 9, 2023 · 0 comments
Open
2 tasks

Comments

@kris-rowe
Copy link

Details

The CUDA and HIP backends use several utility functions for launching kernels, given the grid and block sizes. For consistency, it would be helpful to refactor the SYCL backends to match this usage pattern.

Utility functions for launching kernels could be defined using templates, e.g.

template<typename KernelName, int dim, typename... ArgTypes>
void launchKernel(sycl::queue& q, sycl::range<dim> kernel_range, ArgTypes... args) {
  q.submit([&](sycl::handler& cgh){
    KernelName launched_kernel(args...);
    cgh.parallel_for(kernel_range,launched_kernel);
  });
}

provide the kernels are defined as function objects.

Todo

  • Turn existing lambdas into function objects and move to header files
  • Define templates for launching kernels
@kris-rowe kris-rowe added the sycl label Mar 9, 2023
@kris-rowe kris-rowe self-assigned this Mar 9, 2023
@kris-rowe kris-rowe removed their assignment Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant