mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-30 08:18:30 +00:00
Add OpenMP support
This commit is contained in:
parent
c1e18e7903
commit
5f8e9f14c1
742 changed files with 94643 additions and 1279 deletions
176
third_party/openmp/kmp_config.h
vendored
Normal file
176
third_party/openmp/kmp_config.h
vendored
Normal file
|
@ -0,0 +1,176 @@
|
|||
/*
|
||||
* kmp_config.h -- Feature macros
|
||||
*/
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
#ifndef KMP_CONFIG_H
|
||||
#define KMP_CONFIG_H
|
||||
|
||||
#include "libc/dce.h"
|
||||
#include "kmp_platform.h"
|
||||
|
||||
#ifndef __ASSEMBLER__
|
||||
#include "libc/stdio/syscall.h"
|
||||
#endif
|
||||
|
||||
#define KMP_USE_FUTEX 0
|
||||
#define KMP_FTN_ENTRIES KMP_FTN_PLAIN
|
||||
#define syscall {{openmp_shall_not_use_syscall}}
|
||||
|
||||
#define DEBUG_BUILD IsModeDbg()
|
||||
#define RELWITHDEBINFO_BUILD (IsOptimized() && !IsTiny())
|
||||
#define LIBOMP_USE_ITT_NOTIFY 0
|
||||
#define USE_ITT_NOTIFY LIBOMP_USE_ITT_NOTIFY
|
||||
#if ! LIBOMP_USE_ITT_NOTIFY
|
||||
# define INTEL_NO_ITTNOTIFY_API
|
||||
#endif
|
||||
#define LIBOMP_USE_VERSION_SYMBOLS 0
|
||||
#if LIBOMP_USE_VERSION_SYMBOLS
|
||||
# define KMP_USE_VERSION_SYMBOLS
|
||||
#endif
|
||||
#define LIBOMP_HAVE_WEAK_ATTRIBUTE 1
|
||||
#define KMP_HAVE_WEAK_ATTRIBUTE LIBOMP_HAVE_WEAK_ATTRIBUTE
|
||||
#define LIBOMP_HAVE_PSAPI 0
|
||||
#define KMP_HAVE_PSAPI LIBOMP_HAVE_PSAPI
|
||||
#define LIBOMP_STATS 0
|
||||
#define KMP_STATS_ENABLED LIBOMP_STATS
|
||||
#ifdef __x86_64__
|
||||
#define LIBOMP_HAVE_X86INTRIN_H 1
|
||||
#else
|
||||
#define LIBOMP_HAVE_X86INTRIN_H 0
|
||||
#endif
|
||||
#define KMP_HAVE_X86INTRIN_H LIBOMP_HAVE_X86INTRIN_H
|
||||
#define LIBOMP_HAVE___BUILTIN_READCYCLECOUNTER 0
|
||||
#define KMP_HAVE___BUILTIN_READCYCLECOUNTER LIBOMP_HAVE___BUILTIN_READCYCLECOUNTER
|
||||
#define LIBOMP_HAVE___RDTSC 1
|
||||
#define KMP_HAVE___RDTSC LIBOMP_HAVE___RDTSC
|
||||
#define LIBOMP_USE_DEBUGGER 0
|
||||
#define USE_DEBUGGER LIBOMP_USE_DEBUGGER
|
||||
#define LIBOMP_OMPT_DEBUG 0
|
||||
#define OMPT_DEBUG LIBOMP_OMPT_DEBUG
|
||||
#define LIBOMP_OMPT_SUPPORT 1
|
||||
#define OMPT_SUPPORT LIBOMP_OMPT_SUPPORT
|
||||
#define LIBOMP_OMPD_SUPPORT 0
|
||||
#define OMPD_SUPPORT LIBOMP_OMPD_SUPPORT
|
||||
#define LIBOMP_OMPX_TASKGRAPH 0
|
||||
#define OMPX_TASKGRAPH LIBOMP_OMPX_TASKGRAPH
|
||||
#define LIBOMP_PROFILING_SUPPORT 0
|
||||
#define OMP_PROFILING_SUPPORT LIBOMP_PROFILING_SUPPORT
|
||||
#define LIBOMP_OMPT_OPTIONAL 0
|
||||
#define OMPT_OPTIONAL LIBOMP_OMPT_OPTIONAL
|
||||
#define LIBOMP_USE_ADAPTIVE_LOCKS 0
|
||||
#define KMP_USE_ADAPTIVE_LOCKS LIBOMP_USE_ADAPTIVE_LOCKS
|
||||
#define KMP_DEBUG_ADAPTIVE_LOCKS 0
|
||||
#define LIBOMP_USE_INTERNODE_ALIGNMENT 0
|
||||
#define KMP_USE_INTERNODE_ALIGNMENT LIBOMP_USE_INTERNODE_ALIGNMENT
|
||||
#define LIBOMP_ENABLE_ASSERTIONS 0
|
||||
#define KMP_USE_ASSERT LIBOMP_ENABLE_ASSERTIONS
|
||||
#define LIBOMP_USE_HIER_SCHED 0
|
||||
#define KMP_USE_HIER_SCHED LIBOMP_USE_HIER_SCHED
|
||||
#define STUBS_LIBRARY 0
|
||||
#define LIBOMP_USE_HWLOC 0
|
||||
#define KMP_USE_HWLOC LIBOMP_USE_HWLOC
|
||||
#define LIBOMP_ENABLE_SHARED 0
|
||||
#define KMP_DYNAMIC_LIB LIBOMP_ENABLE_SHARED
|
||||
#define KMP_ARCH_STR "@LIBOMP_LEGAL_ARCH@"
|
||||
#define KMP_LIBRARY_FILE "@LIBOMP_LIB_FILE@"
|
||||
#define KMP_VERSION_MAJOR 5
|
||||
#define KMP_VERSION_MINOR 0
|
||||
#define MSVC 0
|
||||
#define KMP_MSVC_COMPAT MSVC
|
||||
// #define LIBOMP_HAVE_WAITPKG_INTRINSICS
|
||||
#define KMP_HAVE_WAITPKG_INTRINSICS LIBOMP_HAVE_WAITPKG_INTRINSICS
|
||||
// #define LIBOMP_HAVE_RTM_INTRINSICS
|
||||
#define KMP_HAVE_RTM_INTRINSICS LIBOMP_HAVE_RTM_INTRINSICS
|
||||
#ifdef __x86_64__
|
||||
#define LIBOMP_HAVE_IMMINTRIN_H 1
|
||||
#else
|
||||
#define LIBOMP_HAVE_IMMINTRIN_H 0
|
||||
#endif
|
||||
#define KMP_HAVE_IMMINTRIN_H LIBOMP_HAVE_IMMINTRIN_H
|
||||
#define LIBOMP_HAVE_INTRIN_H 0
|
||||
#define KMP_HAVE_INTRIN_H LIBOMP_HAVE_INTRIN_H
|
||||
#define LIBOMP_HAVE_ATTRIBUTE_WAITPKG 0
|
||||
#define KMP_HAVE_ATTRIBUTE_WAITPKG LIBOMP_HAVE_ATTRIBUTE_WAITPKG
|
||||
#define LIBOMP_HAVE_ATTRIBUTE_RTM 0
|
||||
#define KMP_HAVE_ATTRIBUTE_RTM LIBOMP_HAVE_ATTRIBUTE_RTM
|
||||
#define LIBOMP_ARCH_AARCH64_A64FX 0
|
||||
#define KMP_ARCH_AARCH64_A64FX LIBOMP_ARCH_AARCH64_A64FX
|
||||
#ifdef __x86_64__
|
||||
#define LIBOMP_HAVE_XMMINTRIN_H 1
|
||||
#else
|
||||
#define LIBOMP_HAVE_XMMINTRIN_H 0
|
||||
#endif
|
||||
#define KMP_HAVE_XMMINTRIN_H LIBOMP_HAVE_XMMINTRIN_H
|
||||
#ifdef __x86_64__
|
||||
#define LIBOMP_HAVE__MM_MALLOC 1
|
||||
#else
|
||||
#define LIBOMP_HAVE__MM_MALLOC 0
|
||||
#endif
|
||||
#define KMP_HAVE__MM_MALLOC LIBOMP_HAVE__MM_MALLOC
|
||||
#define LIBOMP_HAVE_ALIGNED_ALLOC 1
|
||||
#define KMP_HAVE_ALIGNED_ALLOC LIBOMP_HAVE_ALIGNED_ALLOC
|
||||
#define LIBOMP_HAVE_POSIX_MEMALIGN 1
|
||||
#define KMP_HAVE_POSIX_MEMALIGN LIBOMP_HAVE_POSIX_MEMALIGN
|
||||
#define LIBOMP_HAVE__ALIGNED_MALLOC 0
|
||||
#define KMP_HAVE__ALIGNED_MALLOC LIBOMP_HAVE__ALIGNED_MALLOC
|
||||
#define OPENMP_ENABLE_LIBOMPTARGET 0
|
||||
#define ENABLE_LIBOMPTARGET OPENMP_ENABLE_LIBOMPTARGET
|
||||
|
||||
// Configured cache line based on architecture
|
||||
#if KMP_ARCH_PPC64 || KMP_ARCH_PPC
|
||||
# define CACHE_LINE 128
|
||||
#elif KMP_ARCH_AARCH64_A64FX
|
||||
# define CACHE_LINE 256
|
||||
#elif KMP_ARCH_S390X
|
||||
# define CACHE_LINE 256
|
||||
#else
|
||||
# define CACHE_LINE 64
|
||||
#endif
|
||||
|
||||
#if ! KMP_32_BIT_ARCH
|
||||
# define BUILD_I8 1
|
||||
#endif
|
||||
|
||||
#define KMP_NESTED_HOT_TEAMS 1
|
||||
#define KMP_ADJUST_BLOCKTIME 1
|
||||
#define BUILD_PARALLEL_ORDERED 1
|
||||
#define KMP_ASM_INTRINS 1
|
||||
#define USE_ITT_BUILD LIBOMP_USE_ITT_NOTIFY
|
||||
#define INTEL_ITTNOTIFY_PREFIX __kmp_itt_
|
||||
#if ! KMP_MIC
|
||||
# define USE_LOAD_BALANCE 1
|
||||
#endif
|
||||
#if ! (KMP_OS_WINDOWS || KMP_OS_DARWIN)
|
||||
# define KMP_TDATA_GTID 1
|
||||
#endif
|
||||
#if STUBS_LIBRARY
|
||||
# define KMP_STUB 1
|
||||
#endif
|
||||
#if DEBUG_BUILD || RELWITHDEBINFO_BUILD
|
||||
# define KMP_DEBUG 1
|
||||
#endif
|
||||
|
||||
#if KMP_OS_WINDOWS
|
||||
# define KMP_WIN_CDECL
|
||||
#else
|
||||
# define BUILD_TV
|
||||
# define KMP_GOMP_COMPAT
|
||||
#endif
|
||||
|
||||
// use shared memory with dynamic library (except Android, where shm_*
|
||||
// functions don't exist).
|
||||
#if KMP_OS_UNIX && KMP_DYNAMIC_LIB && !__ANDROID__
|
||||
#define KMP_USE_SHM
|
||||
#endif
|
||||
|
||||
#ifdef __COSMOPOLITAN__
|
||||
#define KMP_USE_SHM
|
||||
#endif
|
||||
|
||||
#endif // KMP_CONFIG_H
|
Loading…
Add table
Add a link
Reference in a new issue