main.cpp 355 B

1234567891011121314151617
  1. #include <iostream>
  2. #include <omp.h>
  3. int main(void) {
  4. #ifdef _OPENMP
  5. if (omp_get_max_threads() == 2) {
  6. return 0;
  7. } else {
  8. std::cout << "Max threads is " << omp_get_max_threads() << " not 2." << std::endl;
  9. return 1;
  10. }
  11. #else
  12. printf("_OPENMP is not defined; is OpenMP compilation working?\n");
  13. return 1;
  14. #endif
  15. }