Blame SOURCES/libgomp_nonshared.c

999efc
/* Copyright (C) 2019 Free Software Foundation, Inc.
999efc
   Contributed by Jakub Jelinek <jakub@redhat.com>.
999efc
999efc
   This file is part of the GNU Offloading and Multi Processing Library
999efc
   (libgomp).
999efc
  
999efc
   Libgomp is free software; you can redistribute it and/or modify it
999efc
   under the terms of the GNU General Public License as published by
999efc
   the Free Software Foundation; either version 3, or (at your option)
999efc
   any later version.
999efc
999efc
   Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
999efc
   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
999efc
   FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
999efc
   more details.
999efc
999efc
   Under Section 7 of GPL version 3, you are granted additional
999efc
   permissions described in the GCC Runtime Library Exception, version
999efc
   3.1, as published by the Free Software Foundation.
999efc
999efc
   You should have received a copy of the GNU General Public License and
999efc
   a copy of the GCC Runtime Library Exception along with this program;
999efc
   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
999efc
   <http://www.gnu.org/licenses/>.  */
999efc
999efc
/* Remapping of nonmonotonic runtime schedule and maybe nonmonotonic runtime
999efc
   schedule loop entrypoints (the used by GCC 9 and later for runtime
999efc
   schedule without monotonic or nonmonotonic modifiers).
999efc
   RHEL 7 libgomp only implements the GOMP*loop*runtime* entrypoints without
999efc
   nonmonotonic in the names, which always implement monotonic scheduling,
999efc
   but the library doesn't implement any other scheduling, even in GCC 9
999efc
   and monotonic scheduling is a valid implementation of non-monotonic
999efc
   scheduling.  */
999efc
999efc
#include <stdbool.h>
999efc
999efc
typedef unsigned long long ull;
999efc
extern bool GOMP_loop_runtime_start (long, long, long, long *, long *);
999efc
extern bool GOMP_loop_runtime_next (long *, long *);
999efc
extern void GOMP_parallel_loop_runtime (void (*)(void *), void *,
999efc
					unsigned, long, long, long,
999efc
					unsigned);
999efc
extern bool GOMP_loop_ull_runtime_start (bool, ull, ull, ull, ull *, ull *);
999efc
extern bool GOMP_loop_ull_runtime_next (ull *, ull *);
e9307e
extern bool GOMP_loop_dynamic_next (long *, long *);
e9307e
extern bool GOMP_loop_dynamic_start (long, long, long, long, long *, long *);
e9307e
extern bool GOMP_loop_guided_next (long *, long *);
e9307e
extern bool GOMP_loop_guided_start (long, long, long, long, long *, long *);
e9307e
extern bool GOMP_loop_ull_dynamic_next (ull *, ull *);
e9307e
extern bool GOMP_loop_ull_dynamic_start (bool, ull, ull, ull, ull, ull *,
e9307e
					 ull *);
e9307e
extern bool GOMP_loop_ull_guided_next (ull *, ull *);
e9307e
extern bool GOMP_loop_ull_guided_start (bool, ull, ull, ull, ull, ull *,
e9307e
					ull *);
e9307e
extern void GOMP_parallel_loop_dynamic (void (*)(void *), void *,
e9307e
					unsigned, long, long, long, long,
e9307e
					unsigned);
e9307e
extern void GOMP_parallel_loop_guided (void (*)(void *), void *,
e9307e
				       unsigned, long, long, long, long,
e9307e
				       unsigned);
999efc
#define alias(x, y) __typeof (x) y __attribute__((alias (#x)))
999efc
999efc
#pragma GCC visibility push(hidden)
999efc
999efc
bool
999efc
GOMP_loop_nonmonotonic_runtime_start (long start, long end, long incr,
999efc
				      long *istart, long *iend)
999efc
{
999efc
  return GOMP_loop_runtime_start (start, end, incr, istart, iend);
999efc
}
999efc
alias (GOMP_loop_nonmonotonic_runtime_start,
999efc
       GOMP_loop_maybe_nonmonotonic_runtime_start);
999efc
999efc
bool
999efc
GOMP_loop_nonmonotonic_runtime_next (long *istart, long *iend)
999efc
{
999efc
  return GOMP_loop_runtime_next (istart, iend);
999efc
}
999efc
alias (GOMP_loop_nonmonotonic_runtime_next,
999efc
       GOMP_loop_maybe_nonmonotonic_runtime_next);
999efc
999efc
void
999efc
GOMP_parallel_loop_nonmonotonic_runtime (void (*fn)(void *), void *data,
999efc
					 unsigned num_threads, long start,
999efc
					 long end, long incr, unsigned flags)
999efc
{
999efc
  return GOMP_parallel_loop_runtime (fn, data, num_threads, start,
999efc
				     end, incr, flags);
999efc
}
999efc
alias (GOMP_parallel_loop_nonmonotonic_runtime,
999efc
       GOMP_parallel_loop_maybe_nonmonotonic_runtime);
999efc
999efc
bool
999efc
GOMP_loop_ull_nonmonotonic_runtime_start (bool up, ull start, ull end,
999efc
					  ull incr, ull *istart, ull *iend)
999efc
{
999efc
  return GOMP_loop_ull_runtime_start (up, start, end, incr, istart, iend);
999efc
}
999efc
alias (GOMP_loop_ull_nonmonotonic_runtime_start,
999efc
       GOMP_loop_ull_maybe_nonmonotonic_runtime_start);
999efc
999efc
bool
999efc
GOMP_loop_ull_nonmonotonic_runtime_next (ull *istart, ull *iend)
999efc
{
999efc
  return GOMP_loop_ull_runtime_next (istart, iend);
999efc
}
999efc
alias (GOMP_loop_ull_nonmonotonic_runtime_next,
999efc
       GOMP_loop_ull_maybe_nonmonotonic_runtime_next);
999efc
e9307e
bool
e9307e
GOMP_loop_nonmonotonic_dynamic_next (long *istart, long *iend)
e9307e
{
e9307e
  return GOMP_loop_dynamic_next (istart, iend);
e9307e
}
e9307e
e9307e
bool
e9307e
GOMP_loop_nonmonotonic_dynamic_start (long start, long end, long incr,
e9307e
				      long chunk_size, long *istart,
e9307e
				      long *iend)
e9307e
{
e9307e
  return GOMP_loop_dynamic_start (start, end, incr, chunk_size, istart, iend);
e9307e
}
e9307e
e9307e
bool
e9307e
GOMP_loop_nonmonotonic_guided_next (long *istart, long *iend)
e9307e
{
e9307e
  return GOMP_loop_guided_next (istart, iend);
e9307e
}
e9307e
e9307e
bool
e9307e
GOMP_loop_nonmonotonic_guided_start (long start, long end, long incr,
e9307e
				     long chunk_size, long *istart, long *iend)
e9307e
{
e9307e
  return GOMP_loop_guided_start (start, end, incr, chunk_size, istart, iend);
e9307e
}
e9307e
e9307e
bool
e9307e
GOMP_loop_ull_nonmonotonic_dynamic_next (ull *istart, ull *iend)
e9307e
{
e9307e
  return GOMP_loop_ull_dynamic_next (istart, iend);
e9307e
}
e9307e
e9307e
bool
e9307e
GOMP_loop_ull_nonmonotonic_dynamic_start (bool up, ull start,
e9307e
					  ull end, ull incr,
e9307e
					  ull chunk_size,
e9307e
					  ull *istart, ull *iend)
e9307e
{
e9307e
  return GOMP_loop_ull_dynamic_start (up, start, end, incr, chunk_size, istart,
e9307e
				      iend);
e9307e
}
e9307e
e9307e
bool
e9307e
GOMP_loop_ull_nonmonotonic_guided_next (ull *istart, ull *iend)
e9307e
{
e9307e
  return GOMP_loop_ull_guided_next (istart, iend);
e9307e
}
e9307e
e9307e
bool
e9307e
GOMP_loop_ull_nonmonotonic_guided_start (bool up, ull start, ull end,
e9307e
					 ull incr, ull chunk_size,
e9307e
					 ull *istart, ull *iend)
e9307e
{
e9307e
  return GOMP_loop_ull_guided_start (up, start, end, incr, chunk_size, istart,
e9307e
				     iend);
e9307e
}
e9307e
e9307e
void
e9307e
GOMP_parallel_loop_nonmonotonic_dynamic (void (*fn) (void *), void *data,
e9307e
					 unsigned num_threads, long start,
e9307e
					 long end, long incr, long chunk_size,
e9307e
					 unsigned flags)
e9307e
{
e9307e
  GOMP_parallel_loop_dynamic (fn, data, num_threads, start, end, incr,
e9307e
			      chunk_size, flags);
e9307e
}
e9307e
e9307e
void
e9307e
GOMP_parallel_loop_nonmonotonic_guided (void (*fn) (void *), void *data,
e9307e
					unsigned num_threads, long start,
e9307e
					long end, long incr, long chunk_size,
e9307e
					unsigned flags)
e9307e
{
e9307e
  GOMP_parallel_loop_guided (fn, data, num_threads, start, end, incr,
e9307e
			     chunk_size, flags);
e9307e
}
e9307e
999efc
#pragma  GCC visibility pop