Fix __HIP_DEVICE_COMPILE__ not defined when hip/math_functions.h is included

This fixes build failure in TensorFlow 1.8 for HCC


[ROCm/hip commit: 450ea49df0]
Bu işleme şunda yer alıyor:
Yaxun Sam Liu
2018-08-07 17:14:39 -04:00
ebeveyn fd1b704358
işleme 735e7ac097
2 değiştirilmiş dosya ile 15 ekleme ve 0 silme
+14
Dosyayı Görüntüle
@@ -31,6 +31,20 @@ THE SOFTWARE.
// declartions.
#include <hip/math_functions.h>
// Test __HIP_DEVICE_COMPILE__ is defined after math_functions.h
// is included.
//
__device__ __host__ inline void throw_std_bad_alloc()
{
#ifndef __HIP_DEVICE_COMPILE__
throw std::bad_alloc();
#else
std::size_t huge = static_cast<std::size_t>(-1);
new int[huge];
#endif
}
#include <hip/hip_runtime.h>
#include "test_common.h"