diff --git a/docs/how-to/hip_rtc.md b/docs/how-to/hip_rtc.md index 344bd7b35e..e509914cd9 100644 --- a/docs/how-to/hip_rtc.md +++ b/docs/how-to/hip_rtc.md @@ -6,10 +6,10 @@ Kernels can be stored as a text string and can be passed to HIPRTC APIs alongsid NOTE: * This library can be used on systems without HIP installed nor AMD GPU driver installed at all (offline compilation). Therefore, it does not depend on any HIP runtime library. -* But it does depend on comgr. You may try to statically link comgr into HIPRTC to avoid any ambiguity. +* But it does depend on COMGr. You may try to statically link COMGr into HIPRTC to avoid any ambiguity. * Developers can decide to bundle this library with their application. -## Example +## Compilation APIs To use HIPRTC functionality, HIPRTC header needs to be included first. `#include ` @@ -32,12 +32,12 @@ R"( Now to compile this kernel, it needs to be associated with `hiprtcProgram` type, which is done by declaring `hiprtcProgram prog;` and associating the string of kernel with this program: ```cpp -hiprtcCreateProgram(&prog, // HIPRTC program - kernel, // kernel string - "gpu_kernel.cu", // Name of the file - num_headers, // Number of headers - &header_sources[0], // Header sources - &header_names[0]); // Name of header files +hiprtcCreateProgram(&prog, // HIPRTC program handle + kernel_source, // HIP kernel source string + "vector_add.cpp", // Name of the HIP program, can be null or an empty string + 0, // Number of headers + NULL, // Header sources + NULL); // Name of header files ``` `hiprtcCreateProgram` API also allows you to add headers which can be included in your RTC program.