#ifndef KMP_DISPATCH_H
#define KMP_DISPATCH_H
#include "kmp.h"
#include "kmp_error.h"
#include "kmp_i18n.h"
#include "kmp_itt.h"
#include "kmp_stats.h"
#include "kmp_str.h"
#if KMP_OS_WINDOWS && KMP_ARCH_X86
#include <float.h>
#endif
#if OMPT_SUPPORT
#include "ompt-internal.h"
#include "ompt-specific.h"
#endif
#if KMP_USE_HIER_SCHED
template <typename T> struct kmp_hier_t;
template <typename T> struct kmp_hier_top_unit_t;
#endif
template <typename T> struct dispatch_shared_info_template;
template <typename T> struct dispatch_private_info_template;
template <typename T>
extern void __kmp_dispatch_init_algorithm(ident_t *loc, int gtid,
dispatch_private_info_template<T> *pr,
enum sched_type schedule, T lb, T ub,
typename traits_t<T>::signed_t st,
#if USE_ITT_BUILD
kmp_uint64 *cur_chunk,
#endif
typename traits_t<T>::signed_t chunk,
T nproc, T unit_id);
template <typename T>
extern int __kmp_dispatch_next_algorithm(
int gtid, dispatch_private_info_template<T> *pr,
dispatch_shared_info_template<T> volatile *sh, kmp_int32 *p_last, T *p_lb,
T *p_ub, typename traits_t<T>::signed_t *p_st, T nproc, T unit_id);
void __kmp_dispatch_dxo_error(int *gtid_ref, int *cid_ref, ident_t *loc_ref);
void __kmp_dispatch_deo_error(int *gtid_ref, int *cid_ref, ident_t *loc_ref);
#if KMP_STATIC_STEAL_ENABLED
template <typename T> struct dispatch_private_infoXX_template { … };
#else
template <typename T> struct dispatch_private_infoXX_template {
typedef typename traits_t<T>::unsigned_t UT;
typedef typename traits_t<T>::signed_t ST;
T lb;
T ub;
ST st;
UT tc;
T parm1;
T parm2;
T parm3;
T parm4;
UT count;
UT ordered_lower;
UT ordered_upper;
#if KMP_OS_WINDOWS
T last_upper;
#endif
};
#endif
template <typename T> struct KMP_ALIGN_CACHE dispatch_private_info_template { … };
template <typename T> struct dispatch_shared_infoXX_template { … };
template <typename T> struct dispatch_shared_info_template { … };
#undef USE_TEST_LOCKS
template <typename T> static __forceinline T test_then_add(volatile T *p, T d);
template <>
__forceinline kmp_int32 test_then_add<kmp_int32>(volatile kmp_int32 *p,
kmp_int32 d) { … }
template <>
__forceinline kmp_int64 test_then_add<kmp_int64>(volatile kmp_int64 *p,
kmp_int64 d) { … }
template <typename T> static __forceinline T test_then_inc_acq(volatile T *p);
template <>
__forceinline kmp_int32 test_then_inc_acq<kmp_int32>(volatile kmp_int32 *p) { … }
template <>
__forceinline kmp_int64 test_then_inc_acq<kmp_int64>(volatile kmp_int64 *p) { … }
template <typename T> static __forceinline T test_then_inc(volatile T *p);
template <>
__forceinline kmp_int32 test_then_inc<kmp_int32>(volatile kmp_int32 *p) { … }
template <>
__forceinline kmp_int64 test_then_inc<kmp_int64>(volatile kmp_int64 *p) { … }
template <typename T>
static __forceinline kmp_int32 compare_and_swap(volatile T *p, T c, T s);
template <>
__forceinline kmp_int32 compare_and_swap<kmp_int32>(volatile kmp_int32 *p,
kmp_int32 c, kmp_int32 s) { … }
template <>
__forceinline kmp_int32 compare_and_swap<kmp_int64>(volatile kmp_int64 *p,
kmp_int64 c, kmp_int64 s) { … }
template <typename T> kmp_uint32 __kmp_ge(T value, T checker) { … }
template <typename T> kmp_uint32 __kmp_eq(T value, T checker) { … }
template <typename UT>
static UT __kmp_wait(volatile UT *spinner, UT checker,
kmp_uint32 (*pred)(UT, UT) USE_ITT_BUILD_ARG(void *obj)) { … }
template <typename UT>
void __kmp_dispatch_deo(int *gtid_ref, int *cid_ref, ident_t *loc_ref) { … }
template <typename UT>
void __kmp_dispatch_dxo(int *gtid_ref, int *cid_ref, ident_t *loc_ref) { … }
template <typename UT>
static __forceinline long double __kmp_pow(long double x, UT y) { … }
template <typename T>
static __inline typename traits_t<T>::unsigned_t
__kmp_dispatch_guided_remaining(T tc, typename traits_t<T>::floating_t base,
typename traits_t<T>::unsigned_t idx) { … }
static const int guided_int_param = …;
static const double guided_flt_param = …;
#endif