Re-enable __builtin_expect when building with NVCC
- NVCC supports this construct as of CUDA 9.0
This commit is contained in:
parent
3ffb4ad2d4
commit
d4042feb2d
@ -79,11 +79,7 @@ limitations under the License.
|
|||||||
// analysis. Giving it this information can help it optimize for the
|
// analysis. Giving it this information can help it optimize for the
|
||||||
// common case in the absence of better information (ie.
|
// common case in the absence of better information (ie.
|
||||||
// -fprofile-arcs).
|
// -fprofile-arcs).
|
||||||
//
|
#if TF_HAS_BUILTIN(__builtin_expect) || (defined(__GNUC__) && __GNUC__ >= 3)
|
||||||
// We need to disable this for GPU builds, though, since nvcc8 and older
|
|
||||||
// don't recognize `__builtin_expect` as a builtin, and fail compilation.
|
|
||||||
#if (!defined(__NVCC__)) && \
|
|
||||||
(TF_HAS_BUILTIN(__builtin_expect) || (defined(__GNUC__) && __GNUC__ >= 3))
|
|
||||||
#define TF_PREDICT_FALSE(x) (__builtin_expect(x, 0))
|
#define TF_PREDICT_FALSE(x) (__builtin_expect(x, 0))
|
||||||
#define TF_PREDICT_TRUE(x) (__builtin_expect(!!(x), 1))
|
#define TF_PREDICT_TRUE(x) (__builtin_expect(!!(x), 1))
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user