divide README into pieces so that the intention of a paragraph is clear
@@ -20,15 +20,18 @@ CuPy arrays work regardless of the underlying memory layouts thanks to `ndarray`
As is the case for this example, `ndarray` abstraction does not need to be used if the underlying memory layouts of arrays match the ones expected by a kernel.
The SGEMM kernel expects input and output arrays to be in Fortran contiguous memory layout, and this layout is enforced by `cupy.asfortranarray`.
+#### How to dynamically compile and launch a kernel function written in CUDA C
For compilation, `load_kernel` is used to compile a CUDA code written in `sgemm.cu`.
This function takes a text of code and name of the kernel as input and returns `cupy.cuda.Function` object.
The compiled code is cached, and it avoids the compilation process after the first time.
Also, the CUDA code can be modified at Python level because it is simply a text.
In this example, C macros that determine distribution of data to threads are specified at runtime.
+Note that `"extern C"` needs to be put on top of the kernel that is called.
+#### How to supply grid size, block size and shared memory size on launching a kernel function
Back to `cupy.cuda.Function`, this object allows you to call the kernel with CUDA's `cuLaunchKernel` interface.
In other words, you have control over grid size, block size, shared memory size and stream id.
-At this level of interface, it becomes straightforward to transfer host `.cu` that calls CUDA kernels to Python.
+At this level of interface, it becomes straightforward to replace host `.cu` that calls CUDA kernels with Python code.
Some points to note.
