compat.openmp
LLVM OpenMP runtime and omp.h, built from source
mcpp add compat.openmp@22.1.8
用法
來自本倉庫自己的測試專案 —— CI 真的編譯並執行過,不是為了網站寫的。
#include <omp.h>
#ifndef _OPENMP
#error "The compiler must enable OpenMP; a header cannot supply _OPENMP."
#endif
int main() {
omp_set_dynamic(0);
int sum = 0;
int threads = 0;
#pragma omp parallel num_threads(2) reduction(+:sum)
{
#pragma omp single
threads = omp_get_num_threads();
sum += omp_get_thread_num() + 1;
}
return threads == 2 && sum == 3 ? 0 : 1;
}
tests/examples/openmp/tests/openmp.cpp · 專案 tests/examples/openmp
建置
- targets
openmp (lib)- language
c++23- C standard
c11- import std
- no
- include dirs
mcpp_openmp/include
原始檔 (1)
mcpp_openmp_anchor.c
版本
| 版本 | 平台 | 鏡像 | sha256 |
|---|---|---|---|
22.1.8 最新 |
LinuxWindowsmacOS | 來源 | 922f1817a0df… |