https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99329

            Bug ID: 99329
           Summary: [OpenMP] device_type(nohost) & host code diagnostic
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid, openmp
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---

Based on https://github.com/SOLLVE/sollve_vv/pull/304#issuecomment-788114379
not yet looked into it.


#pragma omp declare target
int a[N], b[N], c[N];  
int i = 0;
#pragma omp end declare target
void update() { 
  for (i = 0; i < N; i++) {
    a[i] += 1;
    b[i] += 2;
    c[i] += 3;
  }
}

#pragma omp declare target to(update) device_type(nohost)
int test_declare_target_device_type_nohost() { 
  #pragma omp target update to(a,b,c)
  #pragma omp target  
  {
// if (!omp_is_initial_device())  // < no change with this.
    update();
  }
...

CLANG gives for this:

nohost.c:42:6: error: function with 'device_type(nohost)' is not available on
host
     update();
     ^
nohost.c:34:31: note: marked as 'device_type(nohost)' here
#pragma omp declare target to(update) device_type(nohost)

Reply via email to