[gomp4] libgomp.c/target-1.c failing in fn2's GOMP_target_update
Jakub Jelinek
jakub@redhat.com
Fri Nov 8 15:40:00 GMT 2013
On Fri, Nov 08, 2013 at 04:29:03PM +0100, Thomas Schwinge wrote:
>
> On the gomp-4_0-branch, when using the ID 257 device (host fallback but
> with non-shared memory), I see the libgomp.c/target-1.c test fail in
> fn2's GOMP_target_update call:
>
> libgomp: Trying to update [0x601a80..0x601a84) object that is not mapped
>
> Is this a known issue? (I have not yet started debugging that, and
> figured someone more familiar with the code may perhaps easily be able to
> tell what's going wrong.)
That is expected, device 257 is just a temporary testing hack, which doesn't support
variables with "omp declare target" attribute.
So, you can only use it for testcases that don't have any #pragma omp
declare target variables, or if they do, they only access them in #pragma
omp declare target functions, but never try to use them or anything related
to them in map/to/from clauses.
The plan is that using the two proposed tables (host table of host_addr, size
pairs and corresponding target table of target_addr) during initialization
of offloading for a particular shared library resp. binary libgomp will
register all those ranges in the mapping table.
> That aside, I'm using the following patch to enable the ID 257 device
> without having the LIBGOMP_PLUGIN_PATH environment variable set; OK for
> gomp-4_0-branch?
I guess it is ok, once we have at least one supported offloading target,
hopefully we'll nuke device 257.
> libgomp: Always set up device 257 if no other device has been found.
>
> libgomp/
> * target.c (gomp_find_available_plugins): Don't skip device 257
> setup.
>
> diff --git libgomp/target.c libgomp/target.c
> index c0730a7..d84a1fa 100644
> --- libgomp/target.c
> +++ libgomp/target.c
> @@ -651,11 +651,11 @@ gomp_find_available_plugins (void)
>
> plugin_path = getenv ("LIBGOMP_PLUGIN_PATH");
> if (!plugin_path)
> - return;
> + goto out;
>
> dir = opendir (plugin_path);
> if (!dir)
> - return;
> + goto out;
>
> while ((ent = readdir (dir)) != NULL)
> {
> @@ -675,7 +675,7 @@ gomp_find_available_plugins (void)
> {
> num_devices = 0;
> closedir (dir);
> - return;
> + goto out;
> }
>
> devices[num_devices] = current_device;
> @@ -686,6 +686,7 @@ gomp_find_available_plugins (void)
> }
> closedir (dir);
>
> + out:
> /* FIXME: Temporary hack for testing non-shared address spaces on host.
> We create device 257 just to check memory mapping. */
> if (num_devices == 0)
>
>
> GrüÃe,
> Thomas
Jakub
More information about the Gcc
mailing list