Skip to content

Commit 44c0559

Browse files
Graham-CodeplayDuncanMcBain
authored andcommitted
Update CUDA to SYCL converter naming (codeplaysoftware#138)
The folder names have been updated, and minor corrections made to the text of the README.
1 parent a61a955 commit 44c0559

File tree

6 files changed

+13
-10
lines changed

6 files changed

+13
-10
lines changed

utils/cuda_to_sycl/convertor/README.md renamed to utils/cuda_to_sycl/converter/README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
# The SYCL Convertor
1+
# The SYCL Converter
22

3-
A `*.cu` file is a combination of Host CUDA API and device CUDA kernel.
3+
This utility enables developers with existing CUDA kernel code to convert this to SYCL kernel code.
44

5-
This SYCL patterhn is able to re-use an existing CUDA kernel from a `*.cu` file into a C++ kernel, following these steps:
5+
A `*.cu` file is a combination of the Host CUDA API and device CUDA kernel code.
66

7-
1. For the device kernel, we will introduce a SYCL functor that will encapsulate
7+
Existing CUDA kernel code can be transformed into SYCL code using the pattern described in this
8+
document.
9+
10+
1. For the device kernel code, we will introduce a SYCL functor that will encapsulate
811
all the CUDA code, enabling direct re-use of CUDA kernels without major
9-
modifications whenever using simple kernel cases.
12+
modifications for simple kernel use cases.
1013

11-
1. For the host code, the CUDA API is manually replaced with equivalent SYCL/C++ code.
14+
1. For the host code, the CUDA API is manually replaced with the equivalent SYCL C++ code.
1215

1316
## CUDA device kernel
1417

File renamed without changes.
File renamed without changes.

utils/cuda_to_sycl/convertor/compatibility_definitions.hpp renamed to utils/cuda_to_sycl/converter/compatibility_definitions.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,13 @@ struct real_accessor_t<T1, acc_t<T2>> {
155155
};
156156

157157
template <typename conv_t>
158-
struct convertor {
158+
struct converter {
159159
using type = conv_t;
160160
static conv_t inline convert(conv_t c, cl::sycl::handler&) { return c; }
161161
};
162162

163163
template <typename T>
164-
struct convertor<T*> {
164+
struct converter<T*> {
165165
using type = real_accessor_t<T, acc_t<uint8_t>>;
166166
static type inline convert(T* vir_ptr, cl::sycl::handler& h) {
167167
return type(get_global_pointer_mapper().get_access(vir_ptr, h));
@@ -242,10 +242,10 @@ class CudaCommandGroup<KernelT<Param_t...>> {
242242
utility::tuple::IndexList<Is...>) {
243243
auto globalrange = (gridSize_ * blockSize_);
244244
using u_ker_t = KernelT<dim3, dim3, dim3, dim3, cl::sycl::nd_item<3>,
245-
typename convertor<append_param_t>::type...>;
245+
typename converter<append_param_t>::type...>;
246246
using kernel_t = kernel_dispatcher<u_ker_t>;
247247
auto func = kernel_t((
248-
convertor<append_param_t>::convert(utility::tuple::get<Is>(t2), h))...);
248+
converter<append_param_t>::convert(utility::tuple::get<Is>(t2), h))...);
249249
h.parallel_for(
250250
nd_range<3>{
251251
cl::sycl::range<3>(globalrange.x, globalrange.y, globalrange.z),
File renamed without changes.

0 commit comments

Comments
 (0)