Commit f506183d authored by Craig Citro's avatar Craig Citro Committed by TensorFlower Gardener
Browse files

Don't add branch prediction hints when compiling under nvcc.

As seen in #19203, the `__builtin_expect` compiler builtin isn't recognized as
a builtin in nvcc8, leading to compilation failures of the form

    ./tensorflow/core/kernels/gather_functor_gpu.cu.h(57): error: calling a __host__ function("__builtin_
expect") from a __global__ function("tensorflow::GatherOpKernel< ::Eigen::half, int, (bool)1> ") is n
ot allowed

when attempting to build TensorFlow.

This change fixes things by adding an additional check for `__NVCC__`, and
avoiding any branch prediction hints in that case.

PiperOrigin-RevId: 197067418
parent 9249edb7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment