/*========================== begin_copyright_notice ============================
Copyright (C) 2023-2024 Intel Corporation

SPDX-License-Identifier: MIT
============================= end_copyright_notice ===========================*/

/*!
 * @file Library of High-Level Instrumentation (HLI) functions used by GTPin sample tools
 */

#include "hlif_basic_defs.h"

/*!
 * Atomically increment value of *ptr
 * @return old value
 */
IGC_STACK_CALL uint64_t AtomicInc(volatile __global uint64_t *ptr)
{
    return atom_inc(ptr);
}

/*!
 * Atomically increment value of elements[idx]
 * @return  The 'retVal' value
 */
IGC_STACK_CALL uint32_t AtomicElementInc(volatile __global uint64_t* elements, uint32_t idx, uint32_t retVal)
{
    atom_inc(&elements[idx]);
    return retVal;
}
