OpenACC: initialization with unsupported acc_device_t (was: [PR testsuite/65205, libgomp/65993] Fix dg-shouldfail usage in OpenACC libgomp tests)
Julian Brown
julian@codesourcery.com
Thu May 7 15:56:00 GMT 2015
On Tue, 5 May 2015 16:09:18 +0200
Thomas Schwinge <thomas@codesourcery.com> wrote:
> Hi!
>
> On Tue, 5 May 2015 08:43:48 -0400, John David Anglin
> <dave.anglin@bell.net> wrote:
> > On 2015-05-05 5:43 AM, Thomas Schwinge wrote:
> > >> FAIL: libgomp.oacc-c/../libgomp.oacc-c-c++-common/lib-62.c
> > >> >-DACC_DEVICE_TYPE_hos
> > >> >t=1 -DACC_MEM_SHARED=1 output pattern test, is , should match
> > >> >invalid size
> > > With this one I'll need your help: please cite from libgomp.log
> > > (or, from a manual run) the actual output message that you're
> > > getting.
> > There's no output message:
> > # ./lib-62.exe
> > Segmentation fault (core dumped)
> As this is a PA-RISC HP-UX system, I feel certain that you don't
> actually have nvptx offloading available (so, the nvptx libgomp
> plugin is not being built). However, this test case, contains an
> unconditional acc_init call for acc_device_nvidia, and I would then
> guess that this situation is not (not anymore?) correctly handled
> (abort with »offloading to [...] not possible«, or similar; see
> libgomp.oacc-c-c++-common/lib-4.c) in libgomp -- Julian, could this be
> due to your recent libgomp OpenACC initialization changes? (When
> working on this in a build that does have nvptx offloading
> configured, I think you should be able to simulate the situation by
> "hiding" (temporarily deleting, or similar) the nvptx libgomp
> plugin?)
The attached patch contains (what I hope should be) a fix for this,
tested by running the libgomp testsuite (with nvptx offloading), and by
deleting the nvptx plugin, with the patch applied, and ensuring that
lib-62.c no longer segfaults in that case.
The patch also tidies up a few other error paths around resolve_device,
and de-duplicates some error message reporting code.
> Then, I don't know why libgomp.oacc-c-c++-common/lib-62.c contains
> this explicit acc_init call with acc_device_nvidia -- generally, the
> test cases should not contain such unconditional statements. So,
> let's then please remove this. See
> libgomp/testsuite/libgomp.oacc-c-c++-common/lib-66.c for a very
> similar test case, which does this differently.
I've not touched this test though -- but I have tweaked
libgomp.oacc-c-c++-common/lib-4.c that should now expect a slightly
different error output.
OK for trunk?
Thanks,
Julian
ChangeLog
libgomp/
* oacc-init.c (resolve_device): Add FAIL_IS_ERROR argument. Update
function comment. Only call gomp_fatal if new argument is true.
(acc_dev_num_out_of_range): New function.
(acc_init_1, acc_shutdown_1): Update call to resolve_device. Call
acc_dev_num_out_of_range as appropriate.
(acc_get_num_devices, acc_set_device_type, acc_get_device_type)
(acc_get_device_num, acc_set_device_num): Update calls to resolve_device.
* testsuite/libgomp.oacc-c-c++-common/lib-4.c: Update expected test
output.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: init-no-devices-1.diff
Type: text/x-patch
Size: 7041 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150507/002e3c0b/attachment.bin>
More information about the Gcc-patches
mailing list