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 *);
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
999efc
#pragma  GCC visibility pop