Skip to content

Commit 8dd3be8

Browse files
committed
Raise an error for float16 in ReductionKernel.
1 parent 61fe479 commit 8dd3be8

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

pygpu/reduction.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ def __init__(self, context, dtype_out, neutral, reduce_expr, redux,
150150
else:
151151
self.arguments = arguments
152152

153+
if (self.dtype_out == np.dtype('float16') or
154+
any(ar.dtype == numpy.dtype('float16')
155+
for ar in self.arguments)):
156+
raise UnsupportedError('float16 not supported for the reduction interface')
157+
153158
self.reduce_expr = reduce_expr
154159
if map_expr is None:
155160
if len(self.arguments) != 1:

0 commit comments

Comments
 (0)