[OpenMP] target_data_begin: fail on device alloc fail
authorJoel E. Denny <jdenny.ornl@gmail.com>
Tue, 21 Apr 2020 20:27:39 +0000 (16:27 -0400)
committerJoel E. Denny <jdenny.ornl@gmail.com>
Tue, 21 Apr 2020 21:10:50 +0000 (17:10 -0400)
commit5f6aa9680c19534a382cb652178e0ff6edbe78de
treea3f75925dc1ce6e27e8882b848d756ae1086bdac
parentba942610f6be63fe11b61e637ca5db2c4ef9ba8a
[OpenMP] target_data_begin: fail on device alloc fail

Without this patch, target_data_begin continues after an illegal
mapping or an out-of-memory error on the device.  With this patch, it
terminates the runtime with an error instead.

The new test exercises only illegal mappings.  I didn't think of a
good way to exercise out-of-memory errors from the test suite.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D78170
openmp/libomptarget/src/omptarget.cpp
openmp/libomptarget/test/mapping/alloc_fail.c [new file with mode: 0644]