https://bugs.llvm.org/show_bug.cgi?id=47158

            Bug ID: 47158
           Summary: declare target device_type not work as expected
           Product: OpenMP
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Clang Compiler Support
          Assignee: unassignedclangb...@nondot.org
          Reporter: cc...@cray.com
                CC: llvm-bugs@lists.llvm.org

1. Clang emit "error: function with 'device_type(host)' is not available on
device" when `nohost` is specified in device_type
(https://godbolt.org/z/zb5frT):

```
// clang -fopenmp -fopenmp-version=50 -fopenmp-targets=nvptx64 -emit-llvm -S
nohost.c
int device_fun() { return 100; }
#pragma omp declare target to(device_fun) device_type(nohost)

int main() {
#pragma omp target
    {
        device_fun();
    }
}
```

2. Clang emit "function with 'device_type(host)' is not available on device"
when `host` is specified in device_type (https://godbolt.org/z/4M7j8E)

```
// clang -fopenmp -fopenmp-version=50 -fopenmp-targets=nvptx64 -emit-llvm -S
host.c
int host_fun() { return 100; }
#pragma omp declare target to(host_fun) device_type(host)

int main() {
    host_fun();
}
```

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to