Skip to content

Commit dd7d82c

Browse files
committedMay 29, 2017
[OpenCL] Test on half immediate support.
Reviewers: Anastasia Reviewed By: Anastasia Subscribers: yaxunl, cfe-commits, bader Differential Revision: https://reviews.llvm.org/D33592 llvm-svn: 304134
1 parent e3c14eb commit dd7d82c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
 

‎clang/test/CodeGenOpenCL/half.cl

+17
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,20 @@ half test_inc(half x)
2121
{
2222
return ++x;
2323
}
24+
25+
__attribute__((overloadable)) int min(int, int);
26+
__attribute__((overloadable)) half min(half, half);
27+
__attribute__((overloadable)) float min(float, float);
28+
29+
__kernel void foo( __global half* buf, __global float* buf2 )
30+
{
31+
buf[0] = min( buf[0], 1.5h );
32+
// CHECK: half 0xH3E00
33+
buf[0] = min( buf2[0], 1.5f );
34+
// CHECK: float 1.500000e+00
35+
36+
const half one = 1.6666;
37+
buf[1] = min( buf[1], one );
38+
// CHECK: half 0xH3EAB
39+
}
40+

0 commit comments

Comments
 (0)
Please sign in to comment.