mcpp index

compat.openmp

LLVM OpenMP runtime and omp.h, built from source

mcpp add compat.openmp@22.1.8

Usage

From this repository's own test project — built and run by CI, not written for the website.

#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 · project tests/examples/openmp

Build

targets
openmp (lib)
language
c++23
C standard
c11
import std
no
include dirs
mcpp_openmp/include

Sources (1)

  • mcpp_openmp_anchor.c

Versions

VersionPlatforms Mirrorssha256
22.1.8 latest LinuxWindowsmacOS source 922f1817a0df…