Changeset View
Changeset View
Standalone View
Standalone View
openmp/libomptarget/deviceRTLs/common/src/reduction.cu
Show First 20 Lines • Show All 191 Lines • ▼ Show 20 Lines | EXTERN int32_t __kmpc_nvptx_teams_reduce_nowait_v2( | ||||
// In non-generic mode all workers participate in the teams reduction. | // In non-generic mode all workers participate in the teams reduction. | ||||
// In generic mode only the team master participates in the teams | // In generic mode only the team master participates in the teams | ||||
// reduction because the workers are waiting for parallel work. | // reduction because the workers are waiting for parallel work. | ||||
uint32_t NumThreads = | uint32_t NumThreads = | ||||
__kmpc_is_spmd_exec_mode() ? GetNumberOfOmpThreads(/*isSPMDExecutionMode=*/true) | __kmpc_is_spmd_exec_mode() ? GetNumberOfOmpThreads(/*isSPMDExecutionMode=*/true) | ||||
: /*Master thread only*/ 1; | : /*Master thread only*/ 1; | ||||
uint32_t TeamId = GetBlockIdInKernel(); | uint32_t TeamId = GetBlockIdInKernel(); | ||||
uint32_t NumTeams = GetNumberOfBlocksInKernel(); | uint32_t NumTeams = __kmpc_get_hardware_num_blocks(); | ||||
tianshilei1992: Since this part is moved to another patch, they should go in this patch. | |||||
static unsigned SHARED(Bound); | static unsigned SHARED(Bound); | ||||
static unsigned SHARED(ChunkTeamCount); | static unsigned SHARED(ChunkTeamCount); | ||||
// Block progress for teams greater than the current upper | // Block progress for teams greater than the current upper | ||||
// limit. We always only allow a number of teams less or equal | // limit. We always only allow a number of teams less or equal | ||||
// to the number of slots in the buffer. | // to the number of slots in the buffer. | ||||
bool IsMaster = isMaster(loc, ThreadId); | bool IsMaster = isMaster(loc, ThreadId); | ||||
while (IsMaster) { | while (IsMaster) { | ||||
▲ Show 20 Lines • Show All 99 Lines • Show Last 20 Lines |
Since this part is moved to another patch, they should go in this patch.