Provide ldexp float overload for HIP, it's missing in their headers.

PiperOrigin-RevId: 318607361
Change-Id: Id4d3058d3960484e9f2136de7dc72b055c1a3fad
This commit is contained in:
Christian Sigg 2020-06-27 01:35:38 -07:00 committed by TensorFlower Gardener
parent b928c4c5ec
commit 655ce09f67
2 changed files with 11 additions and 0 deletions

View File

@ -30,6 +30,12 @@ limitations under the License.
#include "tensorflow/core/platform/types.h" #include "tensorflow/core/platform/types.h"
#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/logging.h"
#ifdef __HIP_DEVICE_COMPILE__
// Provide ldexp float overload for HIP, it's missing in their headers.
__device__ inline float ldexp(float x, int exp) { return ldexpf(x, exp); }
#endif
namespace tensorflow { namespace tensorflow {
namespace functor { namespace functor {

View File

@ -25,6 +25,11 @@ limitations under the License.
#include "tensorflow/core/kernels/eigen_contraction_kernel.h" #include "tensorflow/core/kernels/eigen_contraction_kernel.h"
#endif #endif
#ifdef __HIP_DEVICE_COMPILE__
// Provide ldexp float overload for HIP, it's missing in their headers.
__device__ inline float ldexp(float x, int exp) { return ldexpf(x, exp); }
#endif
namespace tensorflow { namespace tensorflow {
class OpKernelContext; class OpKernelContext;
namespace functor { namespace functor {