Skip to content

Commit c140d09

Browse files
committed
Move range_reduce_log to a header. Drive-by fix listing libOpenCL.so.1 as well.
1 parent f4ebe09 commit c140d09

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/FastMathFunctions.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
namespace Halide {
1010
namespace Internal {
1111

12-
// Implemented in IROperator.cpp
13-
void range_reduce_log(const Expr &input, Expr *reduced, Expr *exponent);
14-
1512
namespace {
1613

1714
Expr constant(Type t, double value) {
@@ -295,7 +292,7 @@ Expr fast_log(const Expr &x, ApproximationPrecision prec) {
295292

296293
Expr log2 = constant(type, std::log(2.0));
297294
Expr reduced, exponent;
298-
range_reduce_log(x, &reduced, &exponent);
295+
Internal::range_reduce_log(x, &reduced, &exponent);
299296

300297
Expr x1 = reduced - 1.0f;
301298
const Internal::Approximation *approx = Internal::best_log_approximation(prec, type);

src/IROperator.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,6 @@ void match_types_bitwise(Expr &x, Expr &y, const char *op_name) {
743743
// Fast math ops based on those from Syrah (http://github.com/boulos/syrah). Thanks, Solomon!
744744

745745
// Factor a float into 2^exponent * reduced, where reduced is between 0.75 and 1.5
746-
// (This function is not in an anonymous namespace, because it's reused in FastMathFunctions.cpp)
747746
void range_reduce_log(const Expr &input, Expr *reduced, Expr *exponent) {
748747
Type type = input.type();
749748
Type int_type = Int(32, type.lanes());

src/IROperator.h

+3
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,9 @@ Expr halide_exp(const Expr &a);
207207
Expr halide_erf(const Expr &a);
208208
// @}
209209

210+
/** Factor a float into 2^exponent * reduced, where reduced is between 0.75 and 1.5 */
211+
void range_reduce_log(const Expr &input, Expr *reduced, Expr *exponent);
212+
210213
/** Raise an expression to an integer power by repeatedly multiplying
211214
* it by itself. */
212215
Expr raise_to_integer_power(Expr a, int64_t b);

src/runtime/opencl.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ extern "C" WEAK void *halide_opencl_get_symbol(void *user_context, const char *n
3838
"opencl.dll",
3939
#else
4040
"libOpenCL.so",
41+
"libOpenCL.so.1",
4142
"/System/Library/Frameworks/OpenCL.framework/OpenCL",
4243
#endif
4344
};

0 commit comments

Comments
 (0)