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