Blame SOURCES/libgomp_nonshared.c

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