/*========================== begin_copyright_notice ============================
Copyright (C) 2025 Intel Corporation
SPDX-License-Identifier: MIT
============================= end_copyright_notice ===========================*/

/*!
 * @file Library of High-Level Instrumentation (HLI) functions used by HLIF Skeleton tool
 * @note This file contains OpenCL-C code that runs on the GPU device
 */

#include "hli_skeleton.h"

/*!
 * @brief Example HLI function demonstrating the structure of device-side instrumentation code
 * 
 * This function increments a counter to demonstrate basic profiling functionality.
 * In a real profiling tool, you can perform more complex analysis operations such as
 * tracking memory accesses, operation counts, or other runtime metrics.
 * 
 * @param[in,out] ptr Pointer to a 64-bit counter that will be atomically incremented
 */
IGC_STACK_CALL void ExampleFunc(volatile __global uint64_t *ptr)
{
    // Atomically increment the counter to count executions
    atom_inc(ptr);
    // Optional: Print diagnostic message (can be removed in production)
    // printf("ExampleFunc called, counter incremented\n");
}