#ifndef OMPTARGET_OPENMP_INTERNAL_TYPES_H
#define OMPTARGET_OPENMP_INTERNAL_TYPES_H
#include <cstddef>
#include <cstdint>
extern "C" {
typedef struct kmp_depend_info {
intptr_t base_addr;
size_t len;
struct {
bool in : 1;
bool out : 1;
bool mtx : 1;
} flags;
} kmp_depend_info_t;
typedef struct kmp_tasking_flags {
unsigned tiedness : 1;
unsigned final : 1;
unsigned merged_if0 : 1;
code path */
unsigned destructors_thunk : 1;
invoke destructors from the runtime */
unsigned proxy : 1;
context of the RTL) */
unsigned priority_specified : 1;
setting for the task */
unsigned detachable : 1;
unsigned hidden_helper : 1;
unsigned reserved : 8;
unsigned tasktype : 1;
unsigned task_serial : 1;
unsigned tasking_ser : 1;
unsigned team_serial : 1;
unsigned started : 1;
unsigned executing : 1;
unsigned complete : 1;
unsigned freed : 1;
unsigned native : 1;
unsigned reserved31 : 7;
} kmp_tasking_flags_t;
struct kmp_task;
typedef int32_t (*kmp_routine_entry_t)(int32_t, struct kmp_task *);
typedef struct kmp_task {
void *shareds;
kmp_routine_entry_t routine;
int32_t part_id;
} kmp_task_t;
int32_t __kmpc_global_thread_num(void *) __attribute__((weak));
bool __kmpc_omp_has_task_team(int32_t gtid) __attribute__((weak));
void **__kmpc_omp_get_target_async_handle_ptr(int32_t gtid)
__attribute__((weak));
* The argument set that is passed from asynchronous memory copy to block
* version of memory copy invoked in helper task
*/
struct TargetMemcpyArgsTy {
* Common attribuutes
*/
void *Dst;
const void *Src;
int DstDevice;
int SrcDevice;
* The flag that denotes single dimensional or rectangle dimensional copy
*/
bool IsRectMemcpy;
* Arguments for single dimensional copy
*/
size_t Length;
size_t DstOffset;
size_t SrcOffset;
* Arguments for rectangle dimensional copy
*/
size_t ElementSize;
int NumDims;
const size_t *Volume;
const size_t *DstOffsets;
const size_t *SrcOffsets;
const size_t *DstDimensions;
const size_t *SrcDimensions;
* Constructor for single dimensional copy
*/
TargetMemcpyArgsTy(void *Dst, const void *Src, size_t Length,
size_t DstOffset, size_t SrcOffset, int DstDevice,
int SrcDevice)
: Dst(Dst), Src(Src), DstDevice(DstDevice), SrcDevice(SrcDevice),
IsRectMemcpy(false), Length(Length), DstOffset(DstOffset),
SrcOffset(SrcOffset), ElementSize(0), NumDims(0), Volume(0),
DstOffsets(0), SrcOffsets(0), DstDimensions(0), SrcDimensions(0){};
* Constructor for rectangle dimensional copy
*/
TargetMemcpyArgsTy(void *Dst, const void *Src, size_t ElementSize,
int NumDims, const size_t *Volume,
const size_t *DstOffsets, const size_t *SrcOffsets,
const size_t *DstDimensions, const size_t *SrcDimensions,
int DstDevice, int SrcDevice)
: Dst(Dst), Src(Src), DstDevice(DstDevice), SrcDevice(SrcDevice),
IsRectMemcpy(true), Length(0), DstOffset(0), SrcOffset(0),
ElementSize(ElementSize), NumDims(NumDims), Volume(Volume),
DstOffsets(DstOffsets), SrcOffsets(SrcOffsets),
DstDimensions(DstDimensions), SrcDimensions(SrcDimensions){};
};
struct TargetMemsetArgsTy {
void *Ptr;
int C;
size_t N;
int DeviceNum;
};
}
#endif