[OpenMP] Fix warnings for uninitialized block counts

Summary:
Fixes some warning given for uninitialized block counts if the exection mode is
not recognized. This shouldn't happen in practice because the execution mode is
checked when it's read from the device.
This commit is contained in:
Joseph Huber 2021-07-22 08:27:36 -04:00 committed by Huber, Joseph
parent fd3823cc82
commit a158d3663f
2 changed files with 4 additions and 1 deletions

View File

@ -1969,7 +1969,7 @@ launchVals getLaunchVals(EnvironmentVariables Env, int ConstWGSize,
num_groups = ((loop_tripcount - 1) / threadsPerGroup) + 1;
} else if (ExecutionMode == GENERIC) {
num_groups = loop_tripcount;
} else if (ExecutionMode == SPMD_GENERIC) {
} else /* ExecutionMode == SPMD_GENERIC */ {
// This is a generic kernel that was transformed to use SPMD-mode
// execution but uses Generic-mode semantics for scheduling.
num_groups = loop_tripcount;

View File

@ -1069,6 +1069,9 @@ public:
// `teams distribute` region and will create var too few blocks using
// the regular SPMD-mode method.
CudaBlocksPerGrid = LoopTripCount;
} else {
REPORT("Unknown execution mode: %d\n", KernelInfo->ExecutionMode);
return OFFLOAD_FAIL;
}
DP("Using %d teams due to loop trip count %" PRIu32
" and number of threads per block %d\n",