blob: 3f88aeb7e71492e531496563e6b8439d8bf67991 [file] [log] [blame]
Eli Bendersky8578c8f2014-04-15 16:57:53 +00001// RUN: %clang_cc1 %s -triple nvptx-unknown-unknown -fcuda-is-device -emit-llvm -o - | FileCheck %s
2
3#include "../SemaCUDA/cuda.h"
4
5#define MAX_THREADS_PER_BLOCK 256
6#define MIN_BLOCKS_PER_MP 2
7
8// Test both max threads per block and Min cta per sm.
9extern "C" {
10__global__ void
11__launch_bounds__( MAX_THREADS_PER_BLOCK, MIN_BLOCKS_PER_MP )
12Kernel1()
13{
14}
15}
16
17// CHECK: !{{[0-9]+}} = metadata !{void ()* @Kernel1, metadata !"maxntidx", i32 256}
18// CHECK: !{{[0-9]+}} = metadata !{void ()* @Kernel1, metadata !"minctasm", i32 2}
19
20// Test only max threads per block. Min cta per sm defaults to 0, and
21// CodeGen doesn't output a zero value for minctasm.
22extern "C" {
23__global__ void
24__launch_bounds__( MAX_THREADS_PER_BLOCK )
25Kernel2()
26{
27}
28}
29
30// CHECK: !{{[0-9]+}} = metadata !{void ()* @Kernel2, metadata !"maxntidx", i32 256}