brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 62206d3 Raw
32 lines · cpp
1// REQUIRES: amdgpu-registered-target2 3// RUN: %clang_cc1 -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -fopenmp-version=52 -triple powerpc64le-unknown-unknown -DVERBOSE_MODE=1 -verify=omp52 -fnoopenmp-use-tls -ferror-limit 100 -fopenmp-targets=amdgcn-amd-amdhsa -o - %s4 5void fun();6void host_function();7#pragma omp declare target enter(fun) device_type(nohost)8#pragma omp declare variant(host_function) match(device={kind(host)})9void fun() {}10void host_function() {}11void call_host_function() { fun(); }12 13void fun1();14void not_a_host_function();15#pragma omp declare target enter(fun1) device_type(nohost) // omp52-note {{marked as 'device_type(nohost)' here}}16#pragma omp declare variant(not_a_host_function) match(device={kind(host)}) // omp52-error {{function with 'device_type(nohost)' is not available on host}}17void fun1() {}18#pragma omp begin declare target device_type(nohost) // omp52-note {{marked as 'device_type(nohost)' here}}19void not_a_host_function() {}20#pragma omp end declare target21void failed_call_to_host_function() { fun1(); } // omp52-error {{function with 'device_type(nohost)' is not available on host}}22 23void fun2();24void host_function2();25#pragma omp declare target enter(fun2) device_type(nohost)26#pragma omp declare variant(host_function2) match(device={kind(host)})27void fun2() {}28#pragma omp begin declare target device_type(host)29void host_function2() {}30#pragma omp end declare target31void call_to_host_function() { fun2(); }32