aboutsummaryrefslogtreecommitdiff
path: root/gcc/omp-general.c
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2017-05-12 11:02:55 +0200
committerThomas Schwinge <tschwinge@gcc.gnu.org>2017-05-12 11:02:55 +0200
commit25651634436238d505c586fd308cdd5b6c5db8f9 (patch)
tree7fddfeb04f28bb8f5eb26dde13c784b149b14de3 /gcc/omp-general.c
parentee58b02f1160548513a3d00a04acbad93c423b3f (diff)
downloadgcc-25651634436238d505c586fd308cdd5b6c5db8f9.zip
gcc-25651634436238d505c586fd308cdd5b6c5db8f9.tar.gz
gcc-25651634436238d505c586fd308cdd5b6c5db8f9.tar.bz2
Use "oacc kernels" attribute for OpenACC kernels
gcc/ * omp-expand.c (expand_omp_target) <GF_OMP_TARGET_KIND_OACC_KERNELS>: Set "oacc kernels" attribute. * omp-general.c (oacc_set_fn_attrib): Remove is_kernel formal parameter. Adjust all users. (oacc_fn_attrib_kernels_p): Remove function. * omp-offload.c (execute_oacc_device_lower): Look for "oacc kernels" attribute instead of calling oacc_fn_attrib_kernels_p. * tree-ssa-loop.c (gate_oacc_kernels): Likewise. * tree-parloops.c (create_parallel_loop): If oacc_kernels_p, assert "oacc kernels" attribute is set. gcc/testsuite/ * c-c++-common/goacc/classify-kernels-unparallelized.c: Adjust. * c-c++-common/goacc/classify-kernels.c: Likewise. * c-c++-common/goacc/classify-parallel.c: Likewise. * c-c++-common/goacc/classify-routine.c: Likewise. * gfortran.dg/goacc/classify-kernels-unparallelized.f95: Likewise. * gfortran.dg/goacc/classify-kernels.f95: Likewise. * gfortran.dg/goacc/classify-parallel.f95: Likewise. * gfortran.dg/goacc/classify-routine.f95: Likewise. From-SVN: r247955
Diffstat (limited to 'gcc/omp-general.c')
-rw-r--r--gcc/omp-general.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/gcc/omp-general.c b/gcc/omp-general.c
index 3f9aec8..9a5ed88 100644
--- a/gcc/omp-general.c
+++ b/gcc/omp-general.c
@@ -515,11 +515,10 @@ oacc_replace_fn_attrib (tree fn, tree dims)
/* Scan CLAUSES for launch dimensions and attach them to the oacc
function attribute. Push any that are non-constant onto the ARGS
- list, along with an appropriate GOMP_LAUNCH_DIM tag. IS_KERNEL is
- true, if these are for a kernels region offload function. */
+ list, along with an appropriate GOMP_LAUNCH_DIM tag. */
void
-oacc_set_fn_attrib (tree fn, tree clauses, bool is_kernel, vec<tree> *args)
+oacc_set_fn_attrib (tree fn, tree clauses, vec<tree> *args)
{
/* Must match GOMP_DIM ordering. */
static const omp_clause_code ids[]
@@ -545,9 +544,6 @@ oacc_set_fn_attrib (tree fn, tree clauses, bool is_kernel, vec<tree> *args)
non_const |= GOMP_DIM_MASK (ix);
}
attr = tree_cons (NULL_TREE, dim, attr);
- /* Note kernelness with TREE_PUBLIC. */
- if (is_kernel)
- TREE_PUBLIC (attr) = 1;
}
oacc_replace_fn_attrib (fn, attr);
@@ -616,16 +612,6 @@ oacc_get_fn_attrib (tree fn)
return lookup_attribute (OACC_FN_ATTRIB, DECL_ATTRIBUTES (fn));
}
-/* Return true if this oacc fn attrib is for a kernels offload
- region. We use the TREE_PUBLIC flag of each dimension -- only
- need to check the first one. */
-
-bool
-oacc_fn_attrib_kernels_p (tree attr)
-{
- return TREE_PUBLIC (TREE_VALUE (attr));
-}
-
/* Extract an oacc execution dimension from FN. FN must be an
offloaded function or routine that has already had its execution
dimensions lowered to the target-specific values. */