Files
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

127 lines
6.7 KiB
Plaintext

// REQUIRES: nvptx-registered-target
// RUN: %if cir-enabled %{ %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -x cuda -emit-cir -target-sdk-version=12.3 %s -o - | FileCheck --check-prefix=CIR-HOST %s %}
// RUN: %if cir-enabled %{ %clang_cc1 -triple nvptx64-nvidia-cuda -fclangir -fcuda-is-device -emit-cir -target-sdk-version=12.3 %s -o - | FileCheck --check-prefix=CIR-DEVICE %s %}
// RUN: %if cir-enabled %{ %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -x cuda -emit-llvm -target-sdk-version=12.3 %s -o - | FileCheck --check-prefix=LLVM-HOST %s %}
// RUN: %if cir-enabled %{ %clang_cc1 -triple nvptx64-nvidia-cuda -fclangir -fcuda-is-device -emit-llvm -target-sdk-version=12.3 %s -o - | FileCheck --check-prefix=LLVM-DEVICE %s %}
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -x cuda -emit-llvm -target-sdk-version=12.3 %s -o - | FileCheck --check-prefix=OGCG-HOST %s
// RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -fcuda-is-device -emit-llvm -target-sdk-version=12.3 %s -o - | FileCheck --check-prefix=OGCG-DEVICE %s
#include "Inputs/cuda.h"
namespace ns {
// CIR-HOST: cir.func {{.*}} @_ZN2ns36__device_stub__cpp_global_function_1EiPif
// CIR-DEVICE: cir.func {{.*}} @_ZN2ns21cpp_global_function_1EiPif
// LLVM-HOST: define {{.*}} @_ZN2ns36__device_stub__cpp_global_function_1EiPif
// LLVM-DEVICE: define {{.*}} @_ZN2ns21cpp_global_function_1EiPif
// OGCG-HOST: define {{.*}} @_ZN2ns36__device_stub__cpp_global_function_1EiPif
// OGCG-DEVICE: define {{.*}} @_ZN2ns21cpp_global_function_1EiPif
__global__ void cpp_global_function_1(int a, int* b, float c) {}
// CIR-HOST: cir.func {{.*}} @_ZN2ns36__device_stub__cpp_global_function_2EiPif
// CIR-DEVICE: cir.func {{.*}} @_ZN2ns21cpp_global_function_2EiPif
// LLVM-HOST: define {{.*}} @_ZN2ns36__device_stub__cpp_global_function_2EiPif
// LLVM-DEVICE: define {{.*}} @_ZN2ns21cpp_global_function_2EiPif
// OGCG-HOST: define {{.*}} @_ZN2ns36__device_stub__cpp_global_function_2EiPif
// OGCG-DEVICE: define {{.*}} @_ZN2ns21cpp_global_function_2EiPif
__global__ void cpp_global_function_2(int a, int* b, float c) {}
// CIR-HOST: cir.func {{.*}} @_ZN2ns19cpp_host_function_1EiPif
// LLVM-HOST: define {{.*}} @_ZN2ns19cpp_host_function_1EiPif
// OGCG-HOST: define {{.*}} @_ZN2ns19cpp_host_function_1EiPif
__host__ void cpp_host_function_1(int a, int* b, float c) {}
// CIR-HOST: cir.func {{.*}} @_ZN2ns19cpp_host_function_2EiPif
// LLVM-HOST: define {{.*}} @_ZN2ns19cpp_host_function_2EiPif
// OGCG-HOST: define {{.*}} @_ZN2ns19cpp_host_function_2EiPif
__host__ void cpp_host_function_2(int a, int* b, float c) {}
// CIR-DEVICE: cir.func {{.*}} @_ZN2ns21cpp_device_function_1EiPif
// LLVM-DEVICE: define {{.*}} @_ZN2ns21cpp_device_function_1EiPif
// OGCG-DEVICE: define {{.*}} @_ZN2ns21cpp_device_function_1EiPif
__device__ void cpp_device_function_1(int a, int* b, float c) {}
// CIR-DEVICE: cir.func {{.*}} @_ZN2ns21cpp_device_function_2EiPif
// LLVM-DEVICE: define {{.*}} @_ZN2ns21cpp_device_function_2EiPif
// OGCG-DEVICE: define {{.*}} @_ZN2ns21cpp_device_function_2EiPif
__device__ void cpp_device_function_2(int a, int* b, float c) {}
} // namespace ns
// CIR-HOST: cir.func {{.*}} @_Z36__device_stub__cpp_global_function_1iPif
// CIR-DEVICE: cir.func {{.*}} @_Z21cpp_global_function_1iPif
// LLVM-HOST: define {{.*}} @_Z36__device_stub__cpp_global_function_1iPif
// LLVM-DEVICE: define {{.*}} @_Z21cpp_global_function_1iPif
// OGCG-HOST: define {{.*}} @_Z36__device_stub__cpp_global_function_1iPif
// OGCG-DEVICE: define {{.*}} @_Z21cpp_global_function_1iPif
__global__ void cpp_global_function_1(int a, int* b, float c) {}
// CIR-HOST: cir.func {{.*}} @_Z36__device_stub__cpp_global_function_2iPif
// CIR-DEVICE: cir.func {{.*}} @_Z21cpp_global_function_2iPif
// LLVM-HOST: define {{.*}} @_Z36__device_stub__cpp_global_function_2iPif
// LLVM-DEVICE: define {{.*}} @_Z21cpp_global_function_2iPif
// OGCG-HOST: define {{.*}} @_Z36__device_stub__cpp_global_function_2iPif
// OGCG-DEVICE: define {{.*}} @_Z21cpp_global_function_2iPif
__global__ void cpp_global_function_2(int a, int* b, float c) {}
// CIR-HOST: cir.func {{.*}} @_Z19cpp_host_function_1iPif
// LLVM-HOST: define {{.*}} @_Z19cpp_host_function_1iPif
// OGCG-HOST: define {{.*}} @_Z19cpp_host_function_1iPif
__host__ void cpp_host_function_1(int a, int* b, float c) {}
// CIR-HOST: cir.func {{.*}} @_Z19cpp_host_function_2iPif
// LLVM-HOST: define {{.*}} @_Z19cpp_host_function_2iPif
// OGCG-HOST: define {{.*}} @_Z19cpp_host_function_2iPif
__host__ void cpp_host_function_2(int a, int* b, float c) {}
// CIR-DEVICE: cir.func {{.*}} @_Z21cpp_device_function_1iPif
// LLVM-DEVICE: define {{.*}} @_Z21cpp_device_function_1iPif
// OGCG-DEVICE: define {{.*}} @_Z21cpp_device_function_1iPif
__device__ void cpp_device_function_1(int a, int* b, float c) {}
// CIR-DEVICE: cir.func {{.*}} @_Z21cpp_device_function_2iPif
// LLVM-DEVICE: define {{.*}} @_Z21cpp_device_function_2iPif
// OGCG-DEVICE: define {{.*}} @_Z21cpp_device_function_2iPif
__device__ void cpp_device_function_2(int a, int* b, float c) {}
extern "C" {
// CIR-HOST: cir.func {{.*}} @__device_stub__c_global_function_1
// CIR-DEVICE: cir.func {{.*}} @c_global_function_1
// LLVM-HOST: define {{.*}} @__device_stub__c_global_function_1
// LLVM-DEVICE: define {{.*}} @c_global_function_1
// OGCG-HOST: define {{.*}} @__device_stub__c_global_function_1
// OGCG-DEVICE: define {{.*}} @c_global_function_1
__global__ void c_global_function_1(int a, int* b, float c) {}
// CIR-HOST: cir.func {{.*}} @__device_stub__c_global_function_2
// CIR-DEVICE: cir.func {{.*}} @c_global_function_2
// LLVM-HOST: define {{.*}} @__device_stub__c_global_function_2
// LLVM-DEVICE: define {{.*}} @c_global_function_2
// OGCG-HOST: define {{.*}} @__device_stub__c_global_function_2
// OGCG-DEVICE: define {{.*}} @c_global_function_2
__global__ void c_global_function_2(int a, int* b, float c) {}
// CIR-HOST: cir.func {{.*}} @c_host_function_1
// LLVM-HOST: define {{.*}} @c_host_function_1
// OGCG-HOST: define {{.*}} @c_host_function_1
__host__ void c_host_function_1(int a, int* b, float c) {}
// CIR-HOST: cir.func {{.*}} @c_host_function_2
// LLVM-HOST: define {{.*}} @c_host_function_2
// OGCG-HOST: define {{.*}} @c_host_function_2
__host__ void c_host_function_2(int a, int* b, float c) {}
// CIR-DEVICE: cir.func {{.*}} @c_device_function_1
// LLVM-DEVICE: define {{.*}} @c_device_function_1
// OGCG-DEVICE: define {{.*}} @c_device_function_1
__device__ void c_device_function_1(int a, int* b, float c) {}
// CIR-DEVICE: cir.func {{.*}} @c_device_function_2
// LLVM-DEVICE: define {{.*}} @c_device_function_2
// OGCG-DEVICE: define {{.*}} @c_device_function_2
__device__ void c_device_function_2(int a, int* b, float c) {}
} // extern "C"