opencl: replace calls to mathf functions by overloaded function and cast
commitd982432948367e130ac50efac720b821db177e5f
authorSven Verdoolaege <skimo@kotnet.org>
Fri, 23 Jan 2015 22:31:40 +0000 (23 23:31 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Mon, 9 Feb 2015 15:48:47 +0000 (9 16:48 +0100)
treebdcdc33e9da00fc80354c1980599cc3e79f5bd2e
parentc7fcd1caa33bd2fe5d3ff13b62ee5604056e80bf
opencl: replace calls to mathf functions by overloaded function and cast

OpenCL does not have any expf, powf or sqrtf functions but instead
provides overloaded exp, pow and sqrt functions.  If the *f functions
appear in the input code, then they need to be replaced by a cast to float
and a call to the corresponding overloaded function.

This is needed for the upcoming PolyBench/C 4.0.  We currently only handle
those functions used by PolyBench.  Other functions can be added later.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
opencl.c