* [gomp4.1] Remove middle argument of omp_target_is_present
@ 2015-10-09 8:21 Jakub Jelinek
0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2015-10-09 8:21 UTC (permalink / raw)
To: gcc-patches
Hi!
As one can just use pointer-arithmetics on the first argument, and that
argument is the host pointer, there is no point to have an OFFSET argument
and it got removed from the upcoming 4.5.
2015-10-09 Jakub Jelinek <jakub@redhat.com>
* omp.h.in (omp_target_is_present): Remove OFFSET argument.
* target.c (omp_target_is_present): Likewise.
* testsuite/libgomp.c/target-12.c (main): Adjust for removal
of the middle argument of omp_target_is_present.
* testsuite/libgomp.c/target-24.c (main): Likewise.
--- libgomp/omp.h.in.jj 2015-07-10 18:49:17.000000000 +0200
+++ libgomp/omp.h.in 2015-10-09 10:08:55.479460438 +0200
@@ -144,7 +144,7 @@ extern int omp_get_max_task_priority (vo
extern void *omp_target_alloc (__SIZE_TYPE__, int) __GOMP_NOTHROW;
extern void omp_target_free (void *, int) __GOMP_NOTHROW;
-extern int omp_target_is_present (void *, __SIZE_TYPE__, int) __GOMP_NOTHROW;
+extern int omp_target_is_present (void *, int) __GOMP_NOTHROW;
extern int omp_target_memcpy (void *, void *, __SIZE_TYPE__, __SIZE_TYPE__,
__SIZE_TYPE__, int, int) __GOMP_NOTHROW;
extern int omp_target_memcpy_rect (void *, void *, __SIZE_TYPE__, int,
--- libgomp/target.c.jj 2015-09-08 09:55:24.000000000 +0200
+++ libgomp/target.c 2015-10-09 10:09:53.452638946 +0200
@@ -1731,10 +1731,10 @@ omp_target_free (void *device_ptr, int d
}
int
-omp_target_is_present (void *ptr, size_t offset, int device_num)
+omp_target_is_present (void *ptr, int device_num)
{
if (ptr == NULL)
- return offset == 0;
+ return 1;
if (device_num == GOMP_DEVICE_HOST_FALLBACK)
return 1;
@@ -1753,7 +1753,7 @@ omp_target_is_present (void *ptr, size_t
struct splay_tree_s *mem_map = &devicep->mem_map;
struct splay_tree_key_s cur_node;
- cur_node.host_start = (uintptr_t) ptr + offset;
+ cur_node.host_start = (uintptr_t) ptr;
cur_node.host_end = cur_node.host_start;
splay_tree_key n = gomp_map_lookup (mem_map, &cur_node);
int ret = n != NULL;
--- libgomp/testsuite/libgomp.c/target-12.c.jj 2015-07-15 13:00:32.000000000 +0200
+++ libgomp/testsuite/libgomp.c/target-12.c 2015-10-09 10:11:17.898442349 +0200
@@ -39,9 +39,9 @@ main ()
if (omp_target_associate_ptr (q, p, 128 * sizeof (int), sizeof (int), d) != 0)
abort ();
- if (omp_target_is_present (q, 0, d) != 1
- || omp_target_is_present (q, 32 * sizeof (int), d) != 1
- || omp_target_is_present (q, 128 * sizeof (int), d) != 1)
+ if (omp_target_is_present (q, d) != 1
+ || omp_target_is_present (&q[32], d) != 1
+ || omp_target_is_present (&q[128], d) != 1)
abort ();
if (omp_target_memcpy (p, q, 128 * sizeof (int), sizeof (int), 0,
--- libgomp/testsuite/libgomp.c/target-24.c.jj 2015-09-02 16:54:13.000000000 +0200
+++ libgomp/testsuite/libgomp.c/target-24.c 2015-10-09 10:11:46.834032335 +0200
@@ -15,28 +15,28 @@ main ()
int shared_mem = 0;
#pragma omp target map (alloc: shared_mem)
shared_mem = 1;
- if (omp_target_is_present (b, 0, d) != shared_mem)
+ if (omp_target_is_present (b, d) != shared_mem)
abort ();
#pragma omp target enter data map (to: a)
- if (omp_target_is_present (b, 0, d) == 0)
+ if (omp_target_is_present (b, d) == 0)
abort ();
#pragma omp target enter data map (alloc: b[:0])
- if (omp_target_is_present (b, 0, d) == 0)
+ if (omp_target_is_present (b, d) == 0)
abort ();
#pragma omp target exit data map (release: b[:0])
- if (omp_target_is_present (b, 0, d) == 0)
+ if (omp_target_is_present (b, d) == 0)
abort ();
#pragma omp target exit data map (release: b[:0])
- if (omp_target_is_present (b, 0, d) != shared_mem)
+ if (omp_target_is_present (b, d) != shared_mem)
abort ();
#pragma omp target enter data map (to: a)
- if (omp_target_is_present (b, 0, d) == 0)
+ if (omp_target_is_present (b, d) == 0)
abort ();
#pragma omp target enter data map (always, to: b[:0])
- if (omp_target_is_present (b, 0, d) == 0)
+ if (omp_target_is_present (b, d) == 0)
abort ();
#pragma omp target exit data map (delete: b[:0])
- if (omp_target_is_present (b, 0, d) != shared_mem)
+ if (omp_target_is_present (b, d) != shared_mem)
abort ();
#pragma omp target exit data map (from: b[:0])
return 0;
Jakub
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-10-09 8:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-09 8:21 [gomp4.1] Remove middle argument of omp_target_is_present Jakub Jelinek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).