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

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

/*!
 * @file Basic type definitions for GTPin HLIF tools
 */

#ifndef HLIF_BASIC_DEFS_H_
#define HLIF_BASIC_DEFS_H_

#if defined(__OPENCL_C_VERSION__)

#define OPENCL_C_LANG __OPENCL_C_VERSION__

#pragma OPENCL EXTENSION cl_khr_int64_base_atomics : enable
//#pragma OPENCL EXTENSION cl_khr_int64_extended_atomics : enable

// All HLI functions must comply the IGC stack-call ABI
// https://github.com/intel-innersource/drivers.gpu.unified/blob/comp/igc/docs/compiler/visa-stackcall-abi/visa-abi-version2.md
#define IGC_STACK_CALL __attribute((annotate("igc-force-stackcall")))

// Alignment of argument values in the combo-array. See description of the GtHliFunction with hasComboParam = true 
#define HLIF_ALIGNED __attribute__ ((aligned (8)))

// Fundamental OpenCL C types
typedef char    int8_t;
typedef uchar   uint8_t;
typedef short   int16_t;
typedef ushort  uint16_t;
typedef int     int32_t;
typedef long    int64_t;
typedef uint    uint32_t;
typedef ulong   uint64_t;

#elif defined(__cplusplus)

#include "gt_basic_defs.h"

#define __global
#define __local
#define __private
#define __constant

#define IGC_STACK_CALL
#define HLIF_ALIGNED alignas(8)

#else

#error "Unsupported language"

#endif


#endif