CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
74 lines
2.3 KiB
Plaintext
74 lines
2.3 KiB
Plaintext
// Check that when we link a bitcode module into a file using
|
|
// -mlink-builtin-bitcode, we apply the same attributes to the functions in that
|
|
// bitcode module as we apply to functions we generate.
|
|
//
|
|
// In particular, we check that ftz and unsafe-math are propagated into the
|
|
// bitcode library as appropriate.
|
|
|
|
// Build the bitcode library. This is not built in CUDA mode, otherwise it
|
|
// might have incompatible attributes. This mirrors how libdevice is built.
|
|
// RUN: %clang_cc1 -x c++ -fconvergent-functions -emit-llvm-bc -DLIB \
|
|
// RUN: %s -o %t.bc -triple nvptx-unknown-unknown
|
|
|
|
// RUN: %clang_cc1 -x cuda %s -emit-llvm -mlink-builtin-bitcode %t.bc -o - \
|
|
// RUN: -fcuda-is-device -triple nvptx-unknown-unknown \
|
|
// RUN: | FileCheck %s --check-prefix=CHECK --check-prefix=NOFTZ
|
|
|
|
// RUN: %clang_cc1 -x cuda %s -emit-llvm -mlink-builtin-bitcode %t.bc \
|
|
// RUN: -fdenormal-fp-math-f32=preserve-sign -o - \
|
|
// RUN: -fcuda-is-device -triple nvptx-unknown-unknown \
|
|
// RUN: | FileCheck %s --check-prefix=CHECK --check-prefix=FTZ
|
|
|
|
// RUN: %clang_cc1 -x cuda %s -emit-llvm -mlink-builtin-bitcode %t.bc \
|
|
// RUN: -fdenormal-fp-math-f32=preserve-sign -o - \
|
|
// RUN: -fcuda-is-device -funsafe-math-optimizations -triple nvptx-unknown-unknown \
|
|
// RUN: | FileCheck %s --check-prefix=CHECK
|
|
|
|
#ifndef LIB
|
|
#include "Inputs/cuda.h"
|
|
#endif
|
|
|
|
// Wrap everything in extern "C" so we don't have to worry about name mangling
|
|
// in the IR.
|
|
extern "C" {
|
|
#ifdef LIB
|
|
|
|
// This function is defined in the library and only declared in the main
|
|
// compilation.
|
|
void lib_fn() {}
|
|
|
|
#else
|
|
|
|
__device__ void lib_fn();
|
|
__global__ void kernel() { lib_fn(); }
|
|
|
|
#endif
|
|
}
|
|
|
|
// The kernel and lib function should have the same attributes.
|
|
// CHECK: define{{.*}} void @kernel() [[kattr:#[0-9]+]]
|
|
// CHECK: define internal void @lib_fn() [[fattr:#[0-9]+]]
|
|
|
|
// FIXME: These -NOT checks do not work as intended and do not check on the same
|
|
// line.
|
|
|
|
// Check the attribute list for kernel.
|
|
// NOFTZ-NOT: denormal_fpenv
|
|
|
|
// CHECK: attributes [[kattr]] = {
|
|
|
|
// CHECK-SAME: convergent
|
|
// CHECK-SAME: norecurse
|
|
|
|
// FTZ-SAME: denormal_fpenv(float: preservesign)
|
|
|
|
// CHECK-SAME: "no-trapping-math"="true"
|
|
|
|
// Check the attribute list for lib_fn.
|
|
// CHECK: attributes [[fattr]] = {
|
|
|
|
// CHECK-SAME: convergent
|
|
// CHECK-NOT: norecurse
|
|
|
|
// CHECK-SAME: "no-trapping-math"="true"
|