Blame SOURCES/libgomp_nonshared.c

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