mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 06:46:36 +00:00

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
25 lines
585 B
C
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;
|
|
}
|