Increase # of teams, and check if omp_get_num_teams on target retunr same number
#include <stdio.h>
#include <omp.h>
-#define HOST_MAX_TEAMS 128
+#define HOST_MAX_TEAMS 70000
#define TRIALS (1)
-#define N (992)
+#define N (HOST_MAX_TEAMS+92)
+int A[N], B[N], C[N], D[N], E[N];
int main(void) {
- int A[N], B[N], C[N], D[N], E[N];
int fail = 0;
//
@@ -17,18 +17,20 @@ int main(void) {
//
for (int i = 0; i < N; i++) {
A[i] = 0;
+ B[i] = 0;
C[i] = 1;
D[i] = i;
E[i] = (-1)*i;
}
int num_teams = omp_is_initial_device() ? HOST_MAX_TEAMS : 512;
- fprintf(stderr, "Using num_teams = %d\n", num_teams);
+ fprintf(stderr, "Using num_teams %d\n", num_teams);
for (int t = 0 ; t < TRIALS ; t++) {
#pragma omp target
#pragma omp teams num_teams(num_teams)
{
A[omp_get_team_num()] += omp_get_team_num();
+ B[omp_get_team_num()] += omp_get_num_teams();
}
}
for (int i = 0 ; i < num_teams ; i++)
@@ -36,6 +38,8 @@ int main(void) {
printf("Error at %d, h = %d, d = %d\n", i, i*TRIALS, A[i]);
fail = 1;
}
+ fprintf(stderr, "Target num_teams[0]=%d\n",B[0]);
+ fprintf(stderr, "Target num_teams[900]=%d\n",B[900]);
if(fail) printf("Failed\n");
else printf("Succeeded\n");
