OpenMP Backend Base Utilities
Provides OpenMP initialization and helper functions for parallel CPU execution.
Procs
proc getNumThreads(): int {.inline, ...raises: [], tags: [], forbids: [].}
- Get current number of OpenMP threads
proc getThreadId(): int {.inline, ...raises: [], tags: [], forbids: [].}
- Get current thread ID (0 to numThreads-1)
proc initOpenMP() {....raises: [], tags: [], forbids: [].}
- Initialize OpenMP runtime Respects OMP_NUM_THREADS environment variable if set
proc omp_get_max_threads(): cint {.importc, header: "<omp.h>", ...raises: [], tags: [], forbids: [].}
proc omp_get_thread_num(): cint {.importc, header: "<omp.h>", ...raises: [], tags: [], forbids: [].}
Templates
template ompParallel(body: untyped)
- Execute a block in parallel context Initializes OpenMP and executes the body