39 lines · plain
1// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -target-cpu gfx1250 -fcuda-is-device -emit-llvm -x hip -o - %s | FileCheck %s2// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -aux-triple amdgcn-amd-amdhsa -emit-llvm -x hip -o - %s | FileCheck --check-prefix=HOST %s3 4#include "Inputs/cuda.h"5 6const int constint = 4;7 8// HOST-NOT: "amdgpu-cluster-dims"9 10// CHECK: "amdgpu-cluster-dims"="2,2,2"11__global__ void __cluster_dims__(2, 2, 2) test_literal_3d() {}12 13// CHECK: "amdgpu-cluster-dims"="2,2,1"14__global__ void __cluster_dims__(2, 2) test_literal_2d() {}15 16// CHECK: "amdgpu-cluster-dims"="4,1,1"17__global__ void __cluster_dims__(4) test_literal_1d() {}18 19// CHECK: "amdgpu-cluster-dims"="4,2,1"20__global__ void __cluster_dims__(constint, constint / 2, 1) test_constant() {}21 22// CHECK: "amdgpu-cluster-dims"="0,0,0"23__global__ void __no_cluster__ test_no_cluster() {}24 25// CHECK: "amdgpu-cluster-dims"="7,1,1"26template<unsigned a>27__global__ void __cluster_dims__(a) test_template_1d() {}28template __global__ void test_template_1d<7>();29 30// CHECK: "amdgpu-cluster-dims"="2,6,1"31template<unsigned a, unsigned b>32__global__ void __cluster_dims__(a, b) test_template_2d() {}33template __global__ void test_template_2d<2, 6>();34 35// CHECK: "amdgpu-cluster-dims"="1,2,3"36template<unsigned a, unsigned b, unsigned c>37__global__ void __cluster_dims__(a, b, c) test_template_3d() {}38template __global__ void test_template_3d<1, 2, 3>();39