hip_kernel_language.md: Update documentation for kernel compilation

Change-Id: I51073363c3e8a8837c5fe2ae5a04dae0d441229e


[ROCm/hip commit: b8495e5961]
This commit is contained in:
Maneesh Gupta
2016-09-04 16:25:02 +05:30
parent a9973913e0
commit 301ae0fa90
@@ -678,14 +678,5 @@ The file format for binary is `.co` which means Code Object. The following comma
[INPUT FILE] = Name of the file containing kernels
[OUTPUT FILE] = Name of the generated code object file```
Note that the kernel file should have `int main(){}` at the end it so that the binary is generated. This happens because HCC generates binaries at linking time rather than compilation.
To load a kernel into HIP, we need both the code object and the name of the kernel stored within the code object.
In order to get name of the kernel, use:
```
$ objdump -x [CODE_OBJECT_FILE]`.
```
CODE_OBJECT_FILE is file generated by hipcc during kernel compilation. The output from objdump has symbol to the kernel whose name is mangled with `grid_launch_parm`, `__functor`, `__cxxamp_trampoline`. An example of how it looks is `ZN12_GLOBAL__N_137_Z3Cpy16grid_launch_parmPfS0__functor19__cxxamp_trampolineEiiiiiiPKfPf` where `Cpy` is the name of the kernel written in C++. The hipLoadKernelModule API needs to specify this mangled name on the HIP/hcc path.