llvm-project/openmp/runtime/test/api/omp_nteams_api_env.c
AndreyChurbanov d7b12004bd [OpenMP] libomp: implement nteams-var and teams-thread-limit-var ICVs
The change includes OMP_NUM_TEAMS, OMP_TEAMS_THREAD_LIMIT env variables,
omp_set_num_teams, omp_get_max_teams, omp_set_teams_thread_limit,
omp_get_teams_thread_limit routines.

Differential Revision: https://reviews.llvm.org/D95003
2021-02-01 22:54:11 +03:00

25 lines
585 B
C

// RUN: %libomp-compile && env OMP_NUM_TEAMS=5 OMP_TEAMS_THREAD_LIMIT=7 %libomp-run
#include <stdio.h>
#include <stdlib.h>
#include <omp.h>
int main(int argc, char** argv)
{
int iset, iget;
iset = 5;
iget = omp_get_max_teams();
if (iset != iget) {
fprintf(stderr, "error: nteams-var set to %d, getter returned %d\n", iset, iget);
exit(1);
}
iset = 7;
iget = omp_get_teams_thread_limit();
if (iset != iget) {
fprintf(stderr, "error: teams-thread-limit-var set to %d, getter returned %d\n", iset, iget);
exit(1);
}
printf("passed\n");
return 0;
}