ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
omp.h
Go to the documentation of this file.
1 /*
2  * include/omp.h.var
3  */
4 
5 
6 //===----------------------------------------------------------------------===//
7 //
8 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
9 // See https://llvm.org/LICENSE.txt for license information.
10 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
11 //
12 //===----------------------------------------------------------------------===//
13 
14 
15 #ifndef __OMP_H
16 # define __OMP_H
17 
18 # include <stdlib.h>
19 # include <stdint.h>
20 
21 # define KMP_VERSION_MAJOR 5
22 # define KMP_VERSION_MINOR 0
23 # define KMP_VERSION_BUILD 20140926
24 # define KMP_BUILD_DATE "No_Timestamp"
25 
26 # ifdef __cplusplus
27  extern "C" {
28 # endif
29 
30 # define omp_set_affinity_format ompc_set_affinity_format
31 # define omp_get_affinity_format ompc_get_affinity_format
32 # define omp_display_affinity ompc_display_affinity
33 # define omp_capture_affinity ompc_capture_affinity
34 
35 # if defined(_WIN32)
36 # define __KAI_KMPC_CONVENTION __cdecl
37 # ifndef __KMP_IMP
38 # define __KMP_IMP __declspec(dllimport)
39 # endif
40 # else
41 # define __KAI_KMPC_CONVENTION
42 # ifndef __KMP_IMP
43 # define __KMP_IMP
44 # endif
45 # endif
46 
47  /* schedule kind constants */
48  typedef enum omp_sched_t {
53  omp_sched_monotonic = 0x80000000
55 
56  /* set API functions */
62 
63  /* query API functions */
80 
81  /* lock API functions */
82  typedef struct omp_lock_t {
83  void * _lk;
85 
91 
92  /* nested lock API functions */
93  typedef struct omp_nest_lock_t {
94  void * _lk;
96 
102 
103  /* OpenMP 5.0 Synchronization hints*/
104  typedef enum omp_sync_hint_t {
115  kmp_lock_hint_hle = (1<<16),
116  kmp_lock_hint_rtm = (1<<17),
117  kmp_lock_hint_adaptive = (1<<18)
119 
120  /* lock hint type for dynamic user lock */
122 
123  /* hinted lock initializers */
126 
127  /* time API functions */
128  extern double __KAI_KMPC_CONVENTION omp_get_wtime (void);
129  extern double __KAI_KMPC_CONVENTION omp_get_wtick (void);
130 
131  /* OpenMP 4.0 */
139 
140  /* OpenMP 4.5 */
142  extern void* __KAI_KMPC_CONVENTION omp_target_alloc(size_t, int);
143  extern void __KAI_KMPC_CONVENTION omp_target_free(void *, int);
145  extern int __KAI_KMPC_CONVENTION omp_target_memcpy(void *, void *, size_t, size_t, size_t, int, int);
146  extern int __KAI_KMPC_CONVENTION omp_target_memcpy_rect(void *, void *, size_t, int, const size_t *,
147  const size_t *, const size_t *, const size_t *, const size_t *, int, int);
148  extern int __KAI_KMPC_CONVENTION omp_target_associate_ptr(void *, void *, size_t, size_t, int);
150 
151  /* OpenMP 5.0 */
153  typedef void * omp_depend_t;
154 
155  /* kmp API functions */
167  extern void __KAI_KMPC_CONVENTION kmp_set_defaults (char const *);
169 
170  /* Intel affinity API */
171  typedef void * kmp_affinity_mask_t;
172 
181 
182  /* OpenMP 4.0 affinity API */
183  typedef enum omp_proc_bind_t {
190 
192 
193  /* OpenMP 4.5 affinity API */
200 
201  extern void * __KAI_KMPC_CONVENTION kmp_malloc (size_t);
202  extern void * __KAI_KMPC_CONVENTION kmp_aligned_malloc (size_t, size_t);
203  extern void * __KAI_KMPC_CONVENTION kmp_calloc (size_t, size_t);
204  extern void * __KAI_KMPC_CONVENTION kmp_realloc (void *, size_t);
205  extern void __KAI_KMPC_CONVENTION kmp_free (void *);
206 
209 
210  /* OpenMP 5.0 Tool Control */
217 
218  typedef enum omp_control_tool_t {
224 
225  extern int __KAI_KMPC_CONVENTION omp_control_tool(int, int, void*);
226 
227  /* OpenMP 5.0 Memory Management */
229 
230  typedef enum {
240 
241  typedef enum {
262 
263  typedef struct {
267 
268 # if defined(_WIN32)
269  // On Windows cl and icl do not support 64-bit enum, let's use integer then.
286 # else
287 # if __cplusplus >= 201103
289 # else
291 # endif
292  {
304 # if __cplusplus >= 201103
305  typedef enum omp_memspace_handle_t : omp_uintptr_t
306 # else
308 # endif
309  {
317 # endif
319  int ntraits, omp_alloctrait_t traits[]);
321 
324 # ifdef __cplusplus
327 # else
330 # endif
331 
332  /* OpenMP 5.0 Affinity Format */
334  extern size_t __KAI_KMPC_CONVENTION omp_get_affinity_format(char *, size_t);
335  extern void __KAI_KMPC_CONVENTION omp_display_affinity(char const *);
336  extern size_t __KAI_KMPC_CONVENTION omp_capture_affinity(char *, size_t, char const *);
337 
338  /* OpenMP 5.0 events */
339 # if defined(_WIN32)
340  // On Windows cl and icl do not support 64-bit enum, let's use integer then.
342 # else
344 # endif
346 
347  /* OpenMP 5.0 Pause Resources */
348  typedef enum omp_pause_resource_t {
351  omp_pause_hard = 2
355 
357 
358  /* OpenMP 5.1 Display Environment */
359  extern void omp_display_env(int verbose);
360 
361 # undef __KAI_KMPC_CONVENTION
362 # undef __KMP_IMP
363 
364  /* Warning:
365  The following typedefs are not standard, deprecated and will be removed in a future release.
366  */
367  typedef int omp_int_t;
368  typedef double omp_wtime_t;
369 
370 # ifdef __cplusplus
371  }
372 # endif
373 
374 #endif /* __OMP_H */
void __KAI_KMPC_CONVENTION omp_init_nest_lock(omp_nest_lock_t *)
size_t __KAI_KMPC_CONVENTION kmp_get_stacksize_s(void)
int __KAI_KMPC_CONVENTION omp_get_num_procs(void)
void __KAI_KMPC_CONVENTION omp_set_default_device(int)
int __KAI_KMPC_CONVENTION omp_target_disassociate_ptr(void *, int)
omp_alloctrait_key_t
Definition: omp.h:230
@ omp_atk_fallback
Definition: omp.h:235
@ omp_atk_pinned
Definition: omp.h:237
@ omp_atk_access
Definition: omp.h:233
@ omp_atk_threadmodel
Definition: omp.h:231
@ omp_atk_alignment
Definition: omp.h:232
@ omp_atk_pool_size
Definition: omp.h:234
@ omp_atk_fb_data
Definition: omp.h:236
@ omp_atk_partition
Definition: omp.h:238
void __KAI_KMPC_CONVENTION omp_set_default_allocator(omp_allocator_handle_t a)
int __KAI_KMPC_CONVENTION omp_get_place_num_procs(int)
int __KAI_KMPC_CONVENTION omp_get_level(void)
int __KAI_KMPC_CONVENTION omp_control_tool(int, int, void *)
void __KAI_KMPC_CONVENTION kmp_destroy_affinity_mask(kmp_affinity_mask_t *)
omp_pause_resource_t
Definition: omp.h:348
@ omp_pause_soft
Definition: omp.h:350
@ omp_pause_hard
Definition: omp.h:351
@ omp_pause_resume
Definition: omp.h:349
void __KAI_KMPC_CONVENTION kmp_set_stacksize(int)
int __KAI_KMPC_CONVENTION omp_is_initial_device(void)
int omp_int_t
Definition: omp.h:367
void * omp_depend_t
Definition: omp.h:153
int __KAI_KMPC_CONVENTION omp_get_max_threads(void)
int __KAI_KMPC_CONVENTION kmp_get_affinity(kmp_affinity_mask_t *)
void *__KAI_KMPC_CONVENTION kmp_aligned_malloc(size_t, size_t)
int __KAI_KMPC_CONVENTION omp_get_active_level(void)
void __KAI_KMPC_CONVENTION omp_set_num_threads(int)
void *__KAI_KMPC_CONVENTION kmp_calloc(size_t, size_t)
void *__KAI_KMPC_CONVENTION omp_alloc(size_t size, omp_allocator_handle_t a)
int __KAI_KMPC_CONVENTION omp_get_team_size(int)
#define __KAI_KMPC_CONVENTION
Definition: omp.h:41
void __KAI_KMPC_CONVENTION omp_init_nest_lock_with_hint(omp_nest_lock_t *, omp_lock_hint_t)
int __KAI_KMPC_CONVENTION kmp_get_affinity_mask_proc(int, kmp_affinity_mask_t *)
int __KAI_KMPC_CONVENTION kmp_get_library(void)
#define omp_get_affinity_format
Definition: omp.h:31
void *__KAI_KMPC_CONVENTION kmp_malloc(size_t)
omp_allocator_handle_t
Definition: omp.h:292
@ omp_thread_mem_alloc
Definition: omp.h:301
@ omp_large_cap_mem_alloc
Definition: omp.h:295
@ omp_low_lat_mem_alloc
Definition: omp.h:298
@ omp_high_bw_mem_alloc
Definition: omp.h:297
@ omp_default_mem_alloc
Definition: omp.h:294
@ KMP_ALLOCATOR_MAX_HANDLE
Definition: omp.h:302
@ omp_null_allocator
Definition: omp.h:293
@ omp_pteam_mem_alloc
Definition: omp.h:300
@ omp_cgroup_mem_alloc
Definition: omp.h:299
@ omp_const_mem_alloc
Definition: omp.h:296
void __KAI_KMPC_CONVENTION kmp_set_library_throughput(void)
#define __KMP_IMP
Definition: omp.h:43
int __KAI_KMPC_CONVENTION omp_get_dynamic(void)
int __KAI_KMPC_CONVENTION omp_get_place_num(void)
int __KAI_KMPC_CONVENTION omp_get_thread_limit(void)
int __KAI_KMPC_CONVENTION kmp_get_affinity_max_proc(void)
void __KAI_KMPC_CONVENTION kmp_set_disp_num_buffers(int)
omp_alloctrait_value_t
Definition: omp.h:241
@ omp_atv_sequential
Definition: omp.h:247
@ omp_atv_cgroup
Definition: omp.h:252
@ omp_atv_all
Definition: omp.h:249
@ omp_atv_interleaved
Definition: omp.h:260
@ omp_atv_false
Definition: omp.h:242
@ omp_atv_environment
Definition: omp.h:257
@ omp_atv_blocked
Definition: omp.h:259
@ omp_atv_thread
Definition: omp.h:250
@ omp_atv_default_mem_fb
Definition: omp.h:253
@ omp_atv_allocator_fb
Definition: omp.h:256
@ omp_atv_pteam
Definition: omp.h:251
@ omp_atv_contended
Definition: omp.h:245
@ omp_atv_null_fb
Definition: omp.h:254
@ omp_atv_nearest
Definition: omp.h:258
@ omp_atv_uncontended
Definition: omp.h:246
@ omp_atv_true
Definition: omp.h:243
@ omp_atv_private
Definition: omp.h:248
@ omp_atv_default
Definition: omp.h:244
@ omp_atv_abort_fb
Definition: omp.h:255
omp_proc_bind_t __KAI_KMPC_CONVENTION omp_get_proc_bind(void)
void __KAI_KMPC_CONVENTION omp_destroy_lock(omp_lock_t *)
int __KAI_KMPC_CONVENTION omp_get_ancestor_thread_num(int)
omp_sync_hint_t omp_lock_hint_t
Definition: omp.h:121
void __KAI_KMPC_CONVENTION omp_free(void *ptr, omp_allocator_handle_t a)
int __KAI_KMPC_CONVENTION omp_get_nested(void)
int __KAI_KMPC_CONVENTION kmp_get_blocktime(void)
int __KAI_KMPC_CONVENTION kmp_set_affinity_mask_proc(int, kmp_affinity_mask_t *)
int __KAI_KMPC_CONVENTION omp_get_num_threads(void)
struct omp_lock_t omp_lock_t
void __KAI_KMPC_CONVENTION kmp_set_warnings_off(void)
struct omp_nest_lock_t omp_nest_lock_t
int __KAI_KMPC_CONVENTION omp_get_num_teams(void)
int __KAI_KMPC_CONVENTION omp_get_cancellation(void)
void __KAI_KMPC_CONVENTION omp_set_schedule(omp_sched_t, int)
void __KAI_KMPC_CONVENTION omp_fulfill_event(omp_event_handle_t event)
int __KAI_KMPC_CONVENTION omp_get_thread_num(void)
omp_sync_hint_t
Definition: omp.h:104
@ omp_lock_hint_uncontended
Definition: omp.h:108
@ kmp_lock_hint_hle
Definition: omp.h:115
@ omp_lock_hint_none
Definition: omp.h:106
@ omp_lock_hint_contended
Definition: omp.h:110
@ omp_sync_hint_uncontended
Definition: omp.h:107
@ omp_sync_hint_contended
Definition: omp.h:109
@ omp_sync_hint_none
Definition: omp.h:105
@ omp_sync_hint_nonspeculative
Definition: omp.h:111
@ omp_lock_hint_nonspeculative
Definition: omp.h:112
@ kmp_lock_hint_rtm
Definition: omp.h:116
@ kmp_lock_hint_adaptive
Definition: omp.h:117
@ omp_lock_hint_speculative
Definition: omp.h:114
@ omp_sync_hint_speculative
Definition: omp.h:113
void __KAI_KMPC_CONVENTION omp_get_schedule(omp_sched_t *, int *)
omp_event_handle_t
Definition: omp.h:343
@ KMP_EVENT_MAX_HANDLE
Definition: omp.h:343
omp_control_tool_t
Definition: omp.h:218
@ omp_control_tool_start
Definition: omp.h:219
@ omp_control_tool_end
Definition: omp.h:222
@ omp_control_tool_flush
Definition: omp.h:221
@ omp_control_tool_pause
Definition: omp.h:220
void __KAI_KMPC_CONVENTION kmp_set_stacksize_s(size_t)
void __KAI_KMPC_CONVENTION kmp_set_library_turnaround(void)
omp_allocator_handle_t __KAI_KMPC_CONVENTION omp_init_allocator(omp_memspace_handle_t m, int ntraits, omp_alloctrait_t traits[])
int __KAI_KMPC_CONVENTION omp_in_final(void)
void __KAI_KMPC_CONVENTION omp_get_place_proc_ids(int, int *)
void __KAI_KMPC_CONVENTION omp_destroy_allocator(omp_allocator_handle_t allocator)
#define omp_set_affinity_format
Definition: omp.h:30
#define omp_display_affinity
Definition: omp.h:32
uintptr_t omp_uintptr_t
Definition: omp.h:228
void __KAI_KMPC_CONVENTION omp_set_dynamic(int)
int __KAI_KMPC_CONVENTION omp_test_lock(omp_lock_t *)
void __KAI_KMPC_CONVENTION omp_init_lock_with_hint(omp_lock_t *, omp_lock_hint_t)
void omp_display_env(int verbose)
double omp_wtime_t
Definition: omp.h:368
void __KAI_KMPC_CONVENTION kmp_set_library(int)
int __KAI_KMPC_CONVENTION omp_get_num_places(void)
double __KAI_KMPC_CONVENTION omp_get_wtime(void)
int __KAI_KMPC_CONVENTION omp_target_is_present(void *, int)
void *__KAI_KMPC_CONVENTION omp_target_alloc(size_t, int)
int __KAI_KMPC_CONVENTION omp_pause_resource(omp_pause_resource_t, int)
#define omp_capture_affinity
Definition: omp.h:33
int __KAI_KMPC_CONVENTION kmp_set_affinity(kmp_affinity_mask_t *)
void __KAI_KMPC_CONVENTION omp_target_free(void *, int)
void __KAI_KMPC_CONVENTION kmp_free(void *)
int __KAI_KMPC_CONVENTION omp_get_max_active_levels(void)
double __KAI_KMPC_CONVENTION omp_get_wtick(void)
void *__KAI_KMPC_CONVENTION kmp_realloc(void *, size_t)
void __KAI_KMPC_CONVENTION omp_unset_nest_lock(omp_nest_lock_t *)
void __KAI_KMPC_CONVENTION kmp_set_blocktime(int)
omp_sched_t
Definition: omp.h:48
@ omp_sched_dynamic
Definition: omp.h:50
@ omp_sched_auto
Definition: omp.h:52
@ omp_sched_monotonic
Definition: omp.h:53
@ omp_sched_guided
Definition: omp.h:51
@ omp_sched_static
Definition: omp.h:49
omp_control_tool_result_t
Definition: omp.h:211
@ omp_control_tool_ignored
Definition: omp.h:215
@ omp_control_tool_notool
Definition: omp.h:212
@ omp_control_tool_success
Definition: omp.h:214
@ omp_control_tool_nocallback
Definition: omp.h:213
int __KAI_KMPC_CONVENTION omp_get_supported_active_levels(void)
void __KAI_KMPC_CONVENTION omp_set_nested(int)
void __KAI_KMPC_CONVENTION omp_set_nest_lock(omp_nest_lock_t *)
void __KAI_KMPC_CONVENTION kmp_set_defaults(char const *)
void __KAI_KMPC_CONVENTION omp_get_partition_place_nums(int *)
void __KAI_KMPC_CONVENTION omp_init_lock(omp_lock_t *)
int __KAI_KMPC_CONVENTION kmp_get_stacksize(void)
int __KAI_KMPC_CONVENTION omp_target_memcpy_rect(void *, void *, size_t, int, const size_t *, const size_t *, const size_t *, const size_t *, const size_t *, int, int)
omp_memspace_handle_t
Definition: omp.h:309
@ KMP_MEMSPACE_MAX_HANDLE
Definition: omp.h:315
@ omp_large_cap_mem_space
Definition: omp.h:311
@ omp_high_bw_mem_space
Definition: omp.h:313
@ omp_default_mem_space
Definition: omp.h:310
@ omp_const_mem_space
Definition: omp.h:312
@ omp_low_lat_mem_space
Definition: omp.h:314
void __KAI_KMPC_CONVENTION kmp_set_library_serial(void)
int __KAI_KMPC_CONVENTION omp_get_num_devices(void)
void __KAI_KMPC_CONVENTION omp_set_max_active_levels(int)
int __KAI_KMPC_CONVENTION omp_get_team_num(void)
void * kmp_affinity_mask_t
Definition: omp.h:171
int __KAI_KMPC_CONVENTION omp_get_max_task_priority(void)
void __KAI_KMPC_CONVENTION kmp_create_affinity_mask(kmp_affinity_mask_t *)
void __KAI_KMPC_CONVENTION omp_destroy_nest_lock(omp_nest_lock_t *)
omp_allocator_handle_t __KAI_KMPC_CONVENTION omp_get_default_allocator(void)
omp_proc_bind_t
Definition: omp.h:183
@ omp_proc_bind_false
Definition: omp.h:184
@ omp_proc_bind_master
Definition: omp.h:186
@ omp_proc_bind_true
Definition: omp.h:185
@ omp_proc_bind_spread
Definition: omp.h:188
@ omp_proc_bind_close
Definition: omp.h:187
int __KAI_KMPC_CONVENTION omp_get_partition_num_places(void)
int __KAI_KMPC_CONVENTION omp_get_initial_device(void)
int __KAI_KMPC_CONVENTION omp_target_associate_ptr(void *, void *, size_t, size_t, int)
int __KAI_KMPC_CONVENTION omp_target_memcpy(void *, void *, size_t, size_t, size_t, int, int)
int __KAI_KMPC_CONVENTION kmp_unset_affinity_mask_proc(int, kmp_affinity_mask_t *)
void __KAI_KMPC_CONVENTION omp_unset_lock(omp_lock_t *)
int __KAI_KMPC_CONVENTION omp_in_parallel(void)
void __KAI_KMPC_CONVENTION omp_set_lock(omp_lock_t *)
int __KAI_KMPC_CONVENTION omp_test_nest_lock(omp_nest_lock_t *)
void __KAI_KMPC_CONVENTION kmp_set_warnings_on(void)
int __KAI_KMPC_CONVENTION omp_get_device_num(void)
int __KAI_KMPC_CONVENTION omp_pause_resource_all(omp_pause_resource_t)
int __KAI_KMPC_CONVENTION omp_get_default_device(void)
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
Definition: opencl-c-base.h:62
#define UINTPTR_MAX
Definition: stdint.h:650
omp_alloctrait_key_t key
Definition: omp.h:264
omp_uintptr_t value
Definition: omp.h:265
Definition: omp.h:82
void * _lk
Definition: omp.h:83
void * _lk
Definition: omp.h:94