pantry/projects/openmp.llvm.org/test.cpp
Andrew c9d90972b3
openmp.llvm.org (#2260)
* package & test

* display-name

* maybe find

* modified:   projects/openmp.llvm.org/package.yml
2023-06-28 15:50:42 -04:00

14 lines
No EOL
321 B
C++

#include <omp.h>
#include <array>
int main (int argc, char** argv) {
std::array<size_t,2> arr = {0,0};
#pragma omp parallel num_threads(2)
{
size_t tid = omp_get_thread_num();
arr.at(tid) = tid + 1;
}
if(arr.at(0) == 1 && arr.at(1) == 2)
return 0;
else
return 1;
}