mcpp index

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…