mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-19 04:06:43 +00:00

This patch renames the `OpenMPIRBuilderConfig` flags to reduce confusion over their meaning. `IsTargetCodegen` becomes `IsGPU`, whereas `IsEmbedded` becomes `IsTargetDevice`. The `-fopenmp-is-device` compiler option is also renamed to `-fopenmp-is-target-device` and the `omp.is_device` MLIR attribute is renamed to `omp.is_target_device`. Getters and setters of all these renamed properties are also updated accordingly. Many unit tests have been updated to use the new names, but an alias for the `-fopenmp-is-device` option is created so that external programs do not stop working after the name change. `IsGPU` is set when the target triple is AMDGCN or NVIDIA PTX, and it is only valid if `IsTargetDevice` is specified as well. `IsTargetDevice` is set by the `-fopenmp-is-target-device` compiler frontend option, which is only added to the OpenMP device invocation for offloading-enabled programs. Differential Revision: https://reviews.llvm.org/D154591
55 lines
2.3 KiB
C
55 lines
2.3 KiB
C
// REQUIRES: nvptx-registered-target
|
|
// RUN: %clang_cc1 -verify -internal-isystem %S/Inputs/include -fopenmp -x c -triple powerpc64le-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc %s -o %t-ppc-host.bc
|
|
// RUN: %clang_cc1 -verify -internal-isystem %S/../../lib/Headers/openmp_wrappers -include __clang_openmp_device_functions.h -internal-isystem %S/Inputs/include -fopenmp -x c -triple nvptx64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host.bc -aux-triple powerpc64le-unknown-unknown -o - | FileCheck %s
|
|
// RUN: %clang_cc1 -verify -internal-isystem %S/Inputs/include -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc %s -o %t-ppc-host.bc
|
|
// RUN: %clang_cc1 -verify -internal-isystem %S/../../lib/Headers/openmp_wrappers -include __clang_openmp_device_functions.h -internal-isystem %S/Inputs/include -fopenmp -x c++ -triple nvptx64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host.bc -aux-triple powerpc64le-unknown-unknown -o - | FileCheck %s
|
|
// expected-no-diagnostics
|
|
|
|
#ifdef __cplusplus
|
|
#include <complex>
|
|
#else
|
|
#include <complex.h>
|
|
#endif
|
|
|
|
// CHECK: define weak {{.*}} @__divsc3
|
|
// CHECK-DAG: call i32 @__nv_isnanf(
|
|
// CHECK-DAG: call i32 @__nv_isinff(
|
|
// CHECK-DAG: call i32 @__nv_finitef(
|
|
// CHECK-DAG: call float @__nv_copysignf(
|
|
// CHECK-DAG: call float @__nv_scalbnf(
|
|
// CHECK-DAG: call float @__nv_fabsf(
|
|
// CHECK-DAG: call float @__nv_logbf(
|
|
|
|
// CHECK: define weak {{.*}} @__mulsc3
|
|
// CHECK-DAG: call i32 @__nv_isnanf(
|
|
// CHECK-DAG: call i32 @__nv_isinff(
|
|
// CHECK-DAG: call float @__nv_copysignf(
|
|
|
|
// CHECK: define weak {{.*}} @__divdc3
|
|
// CHECK-DAG: call i32 @__nv_isnand(
|
|
// CHECK-DAG: call i32 @__nv_isinfd(
|
|
// CHECK-DAG: call i32 @__nv_isfinited(
|
|
// CHECK-DAG: call double @__nv_copysign(
|
|
// CHECK-DAG: call double @__nv_scalbn(
|
|
// CHECK-DAG: call double @__nv_fabs(
|
|
// CHECK-DAG: call double @__nv_logb(
|
|
|
|
// CHECK: define weak {{.*}} @__muldc3
|
|
// CHECK-DAG: call i32 @__nv_isnand(
|
|
// CHECK-DAG: call i32 @__nv_isinfd(
|
|
// CHECK-DAG: call double @__nv_copysign(
|
|
|
|
void test_scmplx(float _Complex a) {
|
|
#pragma omp target
|
|
{
|
|
(void)(a * (a / a));
|
|
}
|
|
}
|
|
|
|
void test_dcmplx(double _Complex a) {
|
|
#pragma omp target
|
|
{
|
|
(void)(a * (a / a));
|
|
}
|
|
}
|