On Mon, Oct 19, 2020 at 06:57:49PM +0100, Kwok Cheung Yeung wrote:
> --- a/libgomp/env.c
> +++ b/libgomp/env.c
> @@ -75,6 +75,7 @@ struct gomp_task_icv gomp_global_icv = {
>  
>  unsigned long gomp_max_active_levels_var = gomp_supported_active_levels;
>  bool gomp_cancel_var = false;
> +enum gomp_target_offload_t gomp_target_offload_var = 
> GOMP_TARGET_OFFLOAD_DEFAULT;

Too long line.

> --- a/libgomp/target.c
> +++ b/libgomp/target.c
> @@ -116,7 +116,13 @@ resolve_device (int device_id)
>      }
>  
>    if (device_id < 0 || device_id >= gomp_get_num_devices ())
> -    return NULL;
> +    {
> +      if (gomp_target_offload_var == GOMP_TARGET_OFFLOAD_MANDATORY
> +       && device_id != GOMP_DEVICE_HOST_FALLBACK)
> +     gomp_fatal ("OMP_TARGET_OFFLOAD is set to MANDATORY, but device not 
> found.");

No full stop at the end of gomp_fatal messages (everywhere in your patch)
for consistency with other gomp_fatal calls.  Also, too long line (similarly
other gomp_fatal calls).  Just use
        gomp_fatal (" .....                                           ... "
                    "..........");

Otherwise LGTM.

        Jakub

Reply via email to