Author: eliben
Date: Tue Apr 15 11:57:53 2014
New Revision: 206303

URL: http://llvm.org/viewvc/llvm-project?rev=206303&view=rev
Log:
Add test case for r206302

Added:
    cfe/trunk/test/CodeGenCUDA/launch-bounds.cu

Added: cfe/trunk/test/CodeGenCUDA/launch-bounds.cu
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCUDA/launch-bounds.cu?rev=206303&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCUDA/launch-bounds.cu (added)
+++ cfe/trunk/test/CodeGenCUDA/launch-bounds.cu Tue Apr 15 11:57:53 2014
@@ -0,0 +1,30 @@
+// RUN: %clang_cc1 %s -triple nvptx-unknown-unknown -fcuda-is-device 
-emit-llvm -o - | FileCheck %s
+
+#include "../SemaCUDA/cuda.h"
+
+#define MAX_THREADS_PER_BLOCK 256
+#define MIN_BLOCKS_PER_MP     2
+
+// Test both max threads per block and Min cta per sm.
+extern "C" {
+__global__ void
+__launch_bounds__( MAX_THREADS_PER_BLOCK, MIN_BLOCKS_PER_MP )
+Kernel1()
+{
+}
+}
+
+// CHECK: !{{[0-9]+}} = metadata !{void ()* @Kernel1, metadata !"maxntidx", 
i32 256}
+// CHECK: !{{[0-9]+}} = metadata !{void ()* @Kernel1, metadata !"minctasm", 
i32 2}
+
+// Test only max threads per block. Min cta per sm defaults to 0, and
+// CodeGen doesn't output a zero value for minctasm.
+extern "C" {
+__global__ void
+__launch_bounds__( MAX_THREADS_PER_BLOCK )
+Kernel2()
+{
+}
+}
+
+// CHECK: !{{[0-9]+}} = metadata !{void ()* @Kernel2, metadata !"maxntidx", 
i32 256}


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to