From ffa2f0634fb7ecd39174dc72feb04d5b86528e50 Mon Sep 17 00:00:00 2001 From: Julia Jiang Date: Fri, 26 Jul 2024 15:29:20 -0400 Subject: [PATCH] SWDEV-447806 - fix for HIP RTC example re-uses kernel variable Change-Id: I9a1d18868098225012d01515c60b7bcdbe7bc533 --- docs/how-to/hip_rtc.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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.