Changeset View
Changeset View
Standalone View
Standalone View
openmp/libomptarget/deviceRTLs/common/omptarget.h
Show First 20 Lines • Show All 175 Lines • ▼ Show 20 Lines | public: | ||||
INLINE omptarget_nvptx_TaskDescr *Level1TaskDescr(int tid) { | INLINE omptarget_nvptx_TaskDescr *Level1TaskDescr(int tid) { | ||||
return &levelOneTaskDescr[tid]; | return &levelOneTaskDescr[tid]; | ||||
} | } | ||||
INLINE void SetTopLevelTaskDescr(int tid, | INLINE void SetTopLevelTaskDescr(int tid, | ||||
omptarget_nvptx_TaskDescr *taskICV) { | omptarget_nvptx_TaskDescr *taskICV) { | ||||
topTaskDescr[tid] = taskICV; | topTaskDescr[tid] = taskICV; | ||||
} | } | ||||
INLINE omptarget_nvptx_TaskDescr *GetTopLevelTaskDescr(int tid) const; | INLINE omptarget_nvptx_TaskDescr *GetTopLevelTaskDescr(int tid) const; | ||||
// parallel | |||||
INLINE uint16_t &NumThreadsForNextParallel(int tid) { | |||||
return nextRegion.tnum[tid]; | |||||
} | |||||
// schedule (for dispatch) | // schedule (for dispatch) | ||||
INLINE kmp_sched_t &ScheduleType(int tid) { return schedule[tid]; } | INLINE kmp_sched_t &ScheduleType(int tid) { return schedule[tid]; } | ||||
INLINE int64_t &Chunk(int tid) { return chunk[tid]; } | INLINE int64_t &Chunk(int tid) { return chunk[tid]; } | ||||
INLINE int64_t &LoopUpperBound(int tid) { return loopUpperBound[tid]; } | INLINE int64_t &LoopUpperBound(int tid) { return loopUpperBound[tid]; } | ||||
INLINE int64_t &NextLowerBound(int tid) { return nextLowerBound[tid]; } | INLINE int64_t &NextLowerBound(int tid) { return nextLowerBound[tid]; } | ||||
INLINE int64_t &Stride(int tid) { return stride[tid]; } | INLINE int64_t &Stride(int tid) { return stride[tid]; } | ||||
INLINE omptarget_nvptx_TeamDescr &TeamContext() { return teamContext; } | INLINE omptarget_nvptx_TeamDescr &TeamContext() { return teamContext; } | ||||
INLINE void InitThreadPrivateContext(int tid); | INLINE void InitThreadPrivateContext(int tid); | ||||
INLINE uint64_t &Cnt() { return cnt; } | INLINE uint64_t &Cnt() { return cnt; } | ||||
private: | private: | ||||
// team context for this team | // team context for this team | ||||
omptarget_nvptx_TeamDescr teamContext; | omptarget_nvptx_TeamDescr teamContext; | ||||
// task ICV for implicit threads in the only parallel region | // task ICV for implicit threads in the only parallel region | ||||
omptarget_nvptx_TaskDescr levelOneTaskDescr[MAX_THREADS_PER_TEAM]; | omptarget_nvptx_TaskDescr levelOneTaskDescr[MAX_THREADS_PER_TEAM]; | ||||
// pointer where to find the current task ICV (top of the stack) | // pointer where to find the current task ICV (top of the stack) | ||||
omptarget_nvptx_TaskDescr *topTaskDescr[MAX_THREADS_PER_TEAM]; | omptarget_nvptx_TaskDescr *topTaskDescr[MAX_THREADS_PER_TEAM]; | ||||
union { | |||||
// Only one of the two is live at the same time. | |||||
// parallel | |||||
uint16_t tnum[MAX_THREADS_PER_TEAM]; | |||||
} nextRegion; | |||||
// schedule (for dispatch) | // schedule (for dispatch) | ||||
kmp_sched_t schedule[MAX_THREADS_PER_TEAM]; // remember schedule type for #for | kmp_sched_t schedule[MAX_THREADS_PER_TEAM]; // remember schedule type for #for | ||||
int64_t chunk[MAX_THREADS_PER_TEAM]; | int64_t chunk[MAX_THREADS_PER_TEAM]; | ||||
int64_t loopUpperBound[MAX_THREADS_PER_TEAM]; | int64_t loopUpperBound[MAX_THREADS_PER_TEAM]; | ||||
// state for dispatch with dyn/guided OR static (never use both at a time) | // state for dispatch with dyn/guided OR static (never use both at a time) | ||||
int64_t nextLowerBound[MAX_THREADS_PER_TEAM]; | int64_t nextLowerBound[MAX_THREADS_PER_TEAM]; | ||||
int64_t stride[MAX_THREADS_PER_TEAM]; | int64_t stride[MAX_THREADS_PER_TEAM]; | ||||
uint64_t cnt; | uint64_t cnt; | ||||
▲ Show 20 Lines • Show All 72 Lines • Show Last 20 Lines |