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

#ifndef HLI_SKELETON_H
#define HLI_SKELETON_H

#include "hlif_basic_defs.h"

#if defined(__cplusplus)
#include "gtpin_api.h"
using namespace gtpin;
#endif

#pragma pack(push, 8)

/*!
 * @brief Example HLI function demonstrating the structure of device-side instrumentation code
 *
 * This function atomically 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
 * @return void
 * @note The function is marked with IGC_STACK_CALL to ensure proper calling convention
 *       when invoked from instrumented GPU code.
 */
IGC_STACK_CALL void ExampleFunc(volatile __global uint64_t *ptr);

#if defined(__cplusplus)

/*!
 * @brief Type alias for the HLI function signature used in host-side instrumentation code
 *
 * This defines the C++ interface for calling ExampleFunc from the GTPin tool.
 * Template parameters specify: <return type, arg0 type, arg1 type, ...>
 * This example defines: void ExampleFunc(uint64_t* ptr);
 */
using ExampleHliFunc = GtHliFunction<void, uint64_t*>;

#endif

#pragma pack(pop)

#endif // HLI_SKELETON_H