1*38fd1498Szrj/* Copyright (C) 2005-2018 Free Software Foundation, Inc. 2*38fd1498Szrj Contributed by Richard Henderson <rth@redhat.com>. 3*38fd1498Szrj 4*38fd1498Szrj This file is part of the GNU Offloading and Multi Processing Library 5*38fd1498Szrj (libgomp). 6*38fd1498Szrj 7*38fd1498Szrj Libgomp is free software; you can redistribute it and/or modify it 8*38fd1498Szrj under the terms of the GNU General Public License as published by 9*38fd1498Szrj the Free Software Foundation; either version 3, or (at your option) 10*38fd1498Szrj any later version. 11*38fd1498Szrj 12*38fd1498Szrj Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY 13*38fd1498Szrj WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14*38fd1498Szrj FOR A PARTICULAR PURPOSE. See the GNU General Public License for 15*38fd1498Szrj more details. 16*38fd1498Szrj 17*38fd1498Szrj Under Section 7 of GPL version 3, you are granted additional 18*38fd1498Szrj permissions described in the GCC Runtime Library Exception, version 19*38fd1498Szrj 3.1, as published by the Free Software Foundation. 20*38fd1498Szrj 21*38fd1498Szrj You should have received a copy of the GNU General Public License and 22*38fd1498Szrj a copy of the GCC Runtime Library Exception along with this program; 23*38fd1498Szrj see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 24*38fd1498Szrj <http://www.gnu.org/licenses/>. */ 25*38fd1498Szrj 26*38fd1498Szrj#ifndef _OMP_H 27*38fd1498Szrj#define _OMP_H 1 28*38fd1498Szrj 29*38fd1498Szrj#ifndef _LIBGOMP_OMP_LOCK_DEFINED 30*38fd1498Szrj#define _LIBGOMP_OMP_LOCK_DEFINED 1 31*38fd1498Szrj/* These two structures get edited by the libgomp build process to 32*38fd1498Szrj reflect the shape of the two types. Their internals are private 33*38fd1498Szrj to the library. */ 34*38fd1498Szrj 35*38fd1498Szrjtypedef struct 36*38fd1498Szrj{ 37*38fd1498Szrj unsigned char _x[@OMP_LOCK_SIZE@] 38*38fd1498Szrj __attribute__((__aligned__(@OMP_LOCK_ALIGN@))); 39*38fd1498Szrj} omp_lock_t; 40*38fd1498Szrj 41*38fd1498Szrjtypedef struct 42*38fd1498Szrj{ 43*38fd1498Szrj unsigned char _x[@OMP_NEST_LOCK_SIZE@] 44*38fd1498Szrj __attribute__((__aligned__(@OMP_NEST_LOCK_ALIGN@))); 45*38fd1498Szrj} omp_nest_lock_t; 46*38fd1498Szrj#endif 47*38fd1498Szrj 48*38fd1498Szrjtypedef enum omp_sched_t 49*38fd1498Szrj{ 50*38fd1498Szrj omp_sched_static = 1, 51*38fd1498Szrj omp_sched_dynamic = 2, 52*38fd1498Szrj omp_sched_guided = 3, 53*38fd1498Szrj omp_sched_auto = 4 54*38fd1498Szrj} omp_sched_t; 55*38fd1498Szrj 56*38fd1498Szrjtypedef enum omp_proc_bind_t 57*38fd1498Szrj{ 58*38fd1498Szrj omp_proc_bind_false = 0, 59*38fd1498Szrj omp_proc_bind_true = 1, 60*38fd1498Szrj omp_proc_bind_master = 2, 61*38fd1498Szrj omp_proc_bind_close = 3, 62*38fd1498Szrj omp_proc_bind_spread = 4 63*38fd1498Szrj} omp_proc_bind_t; 64*38fd1498Szrj 65*38fd1498Szrjtypedef enum omp_lock_hint_t 66*38fd1498Szrj{ 67*38fd1498Szrj omp_lock_hint_none = 0, 68*38fd1498Szrj omp_lock_hint_uncontended = 1, 69*38fd1498Szrj omp_lock_hint_contended = 2, 70*38fd1498Szrj omp_lock_hint_nonspeculative = 4, 71*38fd1498Szrj omp_lock_hint_speculative = 8, 72*38fd1498Szrj} omp_lock_hint_t; 73*38fd1498Szrj 74*38fd1498Szrj#ifdef __cplusplus 75*38fd1498Szrjextern "C" { 76*38fd1498Szrj# define __GOMP_NOTHROW throw () 77*38fd1498Szrj#else 78*38fd1498Szrj# define __GOMP_NOTHROW __attribute__((__nothrow__)) 79*38fd1498Szrj#endif 80*38fd1498Szrj 81*38fd1498Szrjextern void omp_set_num_threads (int) __GOMP_NOTHROW; 82*38fd1498Szrjextern int omp_get_num_threads (void) __GOMP_NOTHROW; 83*38fd1498Szrjextern int omp_get_max_threads (void) __GOMP_NOTHROW; 84*38fd1498Szrjextern int omp_get_thread_num (void) __GOMP_NOTHROW; 85*38fd1498Szrjextern int omp_get_num_procs (void) __GOMP_NOTHROW; 86*38fd1498Szrj 87*38fd1498Szrjextern int omp_in_parallel (void) __GOMP_NOTHROW; 88*38fd1498Szrj 89*38fd1498Szrjextern void omp_set_dynamic (int) __GOMP_NOTHROW; 90*38fd1498Szrjextern int omp_get_dynamic (void) __GOMP_NOTHROW; 91*38fd1498Szrj 92*38fd1498Szrjextern void omp_set_nested (int) __GOMP_NOTHROW; 93*38fd1498Szrjextern int omp_get_nested (void) __GOMP_NOTHROW; 94*38fd1498Szrj 95*38fd1498Szrjextern void omp_init_lock (omp_lock_t *) __GOMP_NOTHROW; 96*38fd1498Szrjextern void omp_init_lock_with_hint (omp_lock_t *, omp_lock_hint_t) 97*38fd1498Szrj __GOMP_NOTHROW; 98*38fd1498Szrjextern void omp_destroy_lock (omp_lock_t *) __GOMP_NOTHROW; 99*38fd1498Szrjextern void omp_set_lock (omp_lock_t *) __GOMP_NOTHROW; 100*38fd1498Szrjextern void omp_unset_lock (omp_lock_t *) __GOMP_NOTHROW; 101*38fd1498Szrjextern int omp_test_lock (omp_lock_t *) __GOMP_NOTHROW; 102*38fd1498Szrj 103*38fd1498Szrjextern void omp_init_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW; 104*38fd1498Szrjextern void omp_init_nest_lock_with_hint (omp_nest_lock_t *, omp_lock_hint_t) 105*38fd1498Szrj __GOMP_NOTHROW; 106*38fd1498Szrjextern void omp_destroy_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW; 107*38fd1498Szrjextern void omp_set_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW; 108*38fd1498Szrjextern void omp_unset_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW; 109*38fd1498Szrjextern int omp_test_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW; 110*38fd1498Szrj 111*38fd1498Szrjextern double omp_get_wtime (void) __GOMP_NOTHROW; 112*38fd1498Szrjextern double omp_get_wtick (void) __GOMP_NOTHROW; 113*38fd1498Szrj 114*38fd1498Szrjextern void omp_set_schedule (omp_sched_t, int) __GOMP_NOTHROW; 115*38fd1498Szrjextern void omp_get_schedule (omp_sched_t *, int *) __GOMP_NOTHROW; 116*38fd1498Szrjextern int omp_get_thread_limit (void) __GOMP_NOTHROW; 117*38fd1498Szrjextern void omp_set_max_active_levels (int) __GOMP_NOTHROW; 118*38fd1498Szrjextern int omp_get_max_active_levels (void) __GOMP_NOTHROW; 119*38fd1498Szrjextern int omp_get_level (void) __GOMP_NOTHROW; 120*38fd1498Szrjextern int omp_get_ancestor_thread_num (int) __GOMP_NOTHROW; 121*38fd1498Szrjextern int omp_get_team_size (int) __GOMP_NOTHROW; 122*38fd1498Szrjextern int omp_get_active_level (void) __GOMP_NOTHROW; 123*38fd1498Szrj 124*38fd1498Szrjextern int omp_in_final (void) __GOMP_NOTHROW; 125*38fd1498Szrj 126*38fd1498Szrjextern int omp_get_cancellation (void) __GOMP_NOTHROW; 127*38fd1498Szrjextern omp_proc_bind_t omp_get_proc_bind (void) __GOMP_NOTHROW; 128*38fd1498Szrjextern int omp_get_num_places (void) __GOMP_NOTHROW; 129*38fd1498Szrjextern int omp_get_place_num_procs (int) __GOMP_NOTHROW; 130*38fd1498Szrjextern void omp_get_place_proc_ids (int, int *) __GOMP_NOTHROW; 131*38fd1498Szrjextern int omp_get_place_num (void) __GOMP_NOTHROW; 132*38fd1498Szrjextern int omp_get_partition_num_places (void) __GOMP_NOTHROW; 133*38fd1498Szrjextern void omp_get_partition_place_nums (int *) __GOMP_NOTHROW; 134*38fd1498Szrj 135*38fd1498Szrjextern void omp_set_default_device (int) __GOMP_NOTHROW; 136*38fd1498Szrjextern int omp_get_default_device (void) __GOMP_NOTHROW; 137*38fd1498Szrjextern int omp_get_num_devices (void) __GOMP_NOTHROW; 138*38fd1498Szrjextern int omp_get_num_teams (void) __GOMP_NOTHROW; 139*38fd1498Szrjextern int omp_get_team_num (void) __GOMP_NOTHROW; 140*38fd1498Szrj 141*38fd1498Szrjextern int omp_is_initial_device (void) __GOMP_NOTHROW; 142*38fd1498Szrjextern int omp_get_initial_device (void) __GOMP_NOTHROW; 143*38fd1498Szrjextern int omp_get_max_task_priority (void) __GOMP_NOTHROW; 144*38fd1498Szrj 145*38fd1498Szrjextern void *omp_target_alloc (__SIZE_TYPE__, int) __GOMP_NOTHROW; 146*38fd1498Szrjextern void omp_target_free (void *, int) __GOMP_NOTHROW; 147*38fd1498Szrjextern int omp_target_is_present (void *, int) __GOMP_NOTHROW; 148*38fd1498Szrjextern int omp_target_memcpy (void *, void *, __SIZE_TYPE__, __SIZE_TYPE__, 149*38fd1498Szrj __SIZE_TYPE__, int, int) __GOMP_NOTHROW; 150*38fd1498Szrjextern int omp_target_memcpy_rect (void *, void *, __SIZE_TYPE__, int, 151*38fd1498Szrj const __SIZE_TYPE__ *, 152*38fd1498Szrj const __SIZE_TYPE__ *, 153*38fd1498Szrj const __SIZE_TYPE__ *, 154*38fd1498Szrj const __SIZE_TYPE__ *, 155*38fd1498Szrj const __SIZE_TYPE__ *, int, int) 156*38fd1498Szrj __GOMP_NOTHROW; 157*38fd1498Szrjextern int omp_target_associate_ptr (void *, void *, __SIZE_TYPE__, 158*38fd1498Szrj __SIZE_TYPE__, int) __GOMP_NOTHROW; 159*38fd1498Szrjextern int omp_target_disassociate_ptr (void *, int) __GOMP_NOTHROW; 160*38fd1498Szrj 161*38fd1498Szrj#ifdef __cplusplus 162*38fd1498Szrj} 163*38fd1498Szrj#endif 164*38fd1498Szrj 165*38fd1498Szrj#endif /* _OMP_H */ 166