@@ -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,
@@ -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;
@@ -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,
@@ -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;