Skip to content

Commit 93b0512

Browse files
committed
Merge pull request halide#282 from white-pony/master
Added minval_f32/maxval_f32 functions for the OpenCL target
2 parents df17338 + e626565 commit 93b0512

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/CodeGen_OpenCL_Dev.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,9 @@ void CodeGen_OpenCL_Dev::init_module() {
353353
src_stream << "#pragma OPENCL FP_CONTRACT ON\n";
354354

355355
// Write out the Halide math functions.
356-
src_stream << "float nan_f32() { return NAN; }\n"
356+
src_stream << "float maxval_f32() {return FLT_MAX;}\n"
357+
<< "float minval_f32() {return -FLT_MAX;}\n"
358+
<< "float nan_f32() { return NAN; }\n"
357359
<< "float neg_inf_f32() { return -INFINITY; }\n"
358360
<< "float inf_f32() { return INFINITY; }\n"
359361
<< "float float_from_bits(unsigned int x) {return as_float(x);}\n"

0 commit comments

Comments
 (0)