clang/test/CodeGenHIP/half.hip
raw| 1 | // REQUIRES: amdgpu-registered-target |
| 2 | // RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -emit-llvm -fcuda-is-device -o - %s | FileCheck %s |
| 3 | |
| 4 | #define __device__ __attribute__((device)) |
| 5 | |
| 6 | // CHECK-LABEL: @_Z2d0DF16_ |
| 7 | // CHECK: fpext |
| 8 | __device__ float d0(_Float16 x) { |
| 9 | return x; |
| 10 | } |
| 11 | |
| 12 | // CHECK-LABEL: @_Z2d1f |
| 13 | // CHECK: fptrunc |
| 14 | __device__ _Float16 d1(float x) { |
| 15 | return x; |
| 16 | } |