Is there no way to use OpenMP teams on the CPU and on Xeon Phi in the native mode? See code and output below for my attempt to do that.
#include <omp.h> #include <cstdio> int main() { #pragma omp teams #pragma omp distribute for (int i = 0; i < 1000; i++) { printf("i=%d team:%d\n", i, omp_get_team_num()); } }
[user@c001-n002 ~]$ icpc -qopenmp test.cpp test.cpp(5): error: teams must be the first and only construct within a target construct #pragma omp teams ^ compilation aborted for test.cpp (code 2) [user@c001-n002 ~]$ [user@c001-n002 ~]$ icpc -qopenmp test.cpp -mmic test.cpp(5): warning #3180: unrecognized OpenMP #pragma #pragma omp teams ^ test.cpp(6): warning #3180: unrecognized OpenMP #pragma #pragma omp distribute ^ [user@c001-n002 ~]$ icc -V Intel(R) C Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 15.0.0.090 Build 20140723 Copyright (C) 1985-2014 Intel Corporation. All rights reserved.