xref: /freebsd/contrib/llvm-project/openmp/runtime/src/kmp_settings.h (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1 /*
2  * kmp_settings.h -- Initialize environment variables
3  */
4 
5 //===----------------------------------------------------------------------===//
6 //
7 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
8 // See https://llvm.org/LICENSE.txt for license information.
9 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef KMP_SETTINGS_H
14 #define KMP_SETTINGS_H
15 
16 void __kmp_reset_global_vars(void);
17 void __kmp_env_initialize(char const *);
18 void __kmp_env_print();
19 void __kmp_env_print_2();
20 void __kmp_display_env_impl(int display_env, int display_env_verbose);
21 #if OMPD_SUPPORT
22 void __kmp_env_dump();
23 #endif
24 
25 int __kmp_initial_threads_capacity(int req_nproc);
26 void __kmp_init_dflt_team_nth();
27 int __kmp_convert_to_milliseconds(char const *);
28 int __kmp_default_tp_capacity(int, int, int);
29 
30 #if KMP_MIC
31 #define KMP_STR_BUF_PRINT_NAME                                                 \
32   __kmp_str_buf_print(buffer, "  %s %s", KMP_I18N_STR(Device), name)
33 #define KMP_STR_BUF_PRINT_NAME_EX(x)                                           \
34   __kmp_str_buf_print(buffer, "  %s %s='", KMP_I18N_STR(Device), x)
35 #define KMP_STR_BUF_PRINT_BOOL_EX(n, v, t, f)                                  \
36   __kmp_str_buf_print(buffer, "  %s %s='%s'\n", KMP_I18N_STR(Device), n,       \
37                       (v) ? t : f)
38 #define KMP_STR_BUF_PRINT_BOOL                                                 \
39   KMP_STR_BUF_PRINT_BOOL_EX(name, value, "TRUE", "FALSE")
40 #define KMP_STR_BUF_PRINT_INT                                                  \
41   __kmp_str_buf_print(buffer, "  %s %s='%d'\n", KMP_I18N_STR(Device), name,    \
42                       value)
43 #define KMP_STR_BUF_PRINT_UINT64                                               \
44   __kmp_str_buf_print(buffer, "  %s %s='%" KMP_UINT64_SPEC "'\n",              \
45                       KMP_I18N_STR(Device), name, value);
46 #define KMP_STR_BUF_PRINT_STR                                                  \
47   __kmp_str_buf_print(buffer, "  %s %s='%s'\n", KMP_I18N_STR(Device), name,    \
48                       value)
49 #else
50 #define KMP_STR_BUF_PRINT_NAME                                                 \
51   __kmp_str_buf_print(buffer, "  %s %s", KMP_I18N_STR(Host), name)
52 #define KMP_STR_BUF_PRINT_NAME_EX(x)                                           \
53   __kmp_str_buf_print(buffer, "  %s %s='", KMP_I18N_STR(Host), x)
54 #define KMP_STR_BUF_PRINT_BOOL_EX(n, v, t, f)                                  \
55   __kmp_str_buf_print(buffer, "  %s %s='%s'\n", KMP_I18N_STR(Host), n,         \
56                       (v) ? t : f)
57 #define KMP_STR_BUF_PRINT_BOOL                                                 \
58   KMP_STR_BUF_PRINT_BOOL_EX(name, value, "TRUE", "FALSE")
59 #define KMP_STR_BUF_PRINT_INT                                                  \
60   __kmp_str_buf_print(buffer, "  %s %s='%d'\n", KMP_I18N_STR(Host), name, value)
61 #define KMP_STR_BUF_PRINT_UINT64                                               \
62   __kmp_str_buf_print(buffer, "  %s %s='%" KMP_UINT64_SPEC "'\n",              \
63                       KMP_I18N_STR(Host), name, value);
64 #define KMP_STR_BUF_PRINT_STR                                                  \
65   __kmp_str_buf_print(buffer, "  %s %s='%s'\n", KMP_I18N_STR(Host), name, value)
66 #endif
67 
68 #endif // KMP_SETTINGS_H
69 
70 // end of file //
71