fix isnan
This commit is contained in:
parent
e5b6219a84
commit
b4dbe7a649
@ -155,16 +155,20 @@ bool CheckNAN(double v);
|
||||
#else
|
||||
|
||||
XGBOOST_DEVICE bool inline CheckNAN(float x) {
|
||||
#if defined(__CUDA_ARCH__) || defined(__HIP_PLATFORM_AMD__)
|
||||
#if defined(__CUDA_ARCH__)
|
||||
return isnan(x);
|
||||
#elif defined(__HIP_PLATFORM_AMD__)
|
||||
return __builtin_isnan(x);
|
||||
#else
|
||||
return std::isnan(x);
|
||||
#endif // defined(__CUDA_ARCH__) || defined(__HIP_PLATFORM_AMD__)
|
||||
}
|
||||
|
||||
XGBOOST_DEVICE bool inline CheckNAN(double x) {
|
||||
#if defined(__CUDA_ARCH__) || defined(__HIP_PLATFORM_AMD__)
|
||||
#if defined(__CUDA_ARCH__)
|
||||
return isnan(x);
|
||||
#elif defined(__HIP_PLATFORM_AMD__)
|
||||
return __builtin_isnan(x);
|
||||
#else
|
||||
return std::isnan(x);
|
||||
#endif // defined(__CUDA_ARCH__) || defined(__HIP_PLATFORM_AMD__)
|
||||
|
||||
@ -15,13 +15,10 @@
|
||||
#include "../filesystem.h" // dmlc::TemporaryDirectory
|
||||
#include "../helpers.h"
|
||||
|
||||
#ifdef __CUDACC__
|
||||
#if defined(__CUDACC__) || defined(__HIP_PLATFORM_AMD__)
|
||||
#include <xgboost/json.h>
|
||||
#include "../../../src/data/device_adapter.cuh"
|
||||
#elif defined(__HIP_PLATFORM_AMD__)
|
||||
#include <xgboost/json.h>
|
||||
#include "../../../src/data/device_adapter.hip.h"
|
||||
#endif // __CUDACC__
|
||||
#endif // __CUDACC__, __HIP_PLATFORM_AMD__
|
||||
|
||||
// Some helper functions used to test both GPU and CPU algorithms
|
||||
//
|
||||
|
||||
@ -7,13 +7,9 @@
|
||||
#include "../helpers.h"
|
||||
#include <thrust/device_vector.h>
|
||||
|
||||
#if defined(XGBOOST_USE_CUDA)
|
||||
#include "../../../src/data/device_adapter.cuh"
|
||||
#elif defined(XGBOOST_USE_HIP)
|
||||
#include "../../../src/data/device_adapter.hip.h"
|
||||
#endif
|
||||
|
||||
#include "test_array_interface.h"
|
||||
|
||||
using namespace xgboost; // NOLINT
|
||||
|
||||
void TestCudfAdapter()
|
||||
|
||||
@ -3,12 +3,7 @@
|
||||
*/
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#if defined(XGBOOST_USE_CUDA)
|
||||
#include "../../../src/data/device_adapter.cuh"
|
||||
#elif defined(XGBOOST_USE_HIP)
|
||||
#include "../../../src/data/device_adapter.hip.h"
|
||||
#endif
|
||||
|
||||
#include "../../../src/data/ellpack_page.cuh"
|
||||
#include "../../../src/data/iterative_dmatrix.h"
|
||||
#include "../helpers.h"
|
||||
|
||||
@ -3,12 +3,7 @@
|
||||
#include <memory>
|
||||
#include "../helpers.h"
|
||||
|
||||
#if defined(XGBOOST_USE_CUDA)
|
||||
#include "../../../src/data/device_adapter.cuh"
|
||||
#elif defined(XGBOOST_USE_HIP)
|
||||
#include "../../../src/data/device_adapter.hip.h"
|
||||
#endif
|
||||
|
||||
#include "../../../src/data/proxy_dmatrix.h"
|
||||
|
||||
namespace xgboost {
|
||||
|
||||
@ -4,12 +4,7 @@
|
||||
|
||||
#include <thrust/sequence.h>
|
||||
|
||||
#if defined(XGBOOST_USE_CUDA)
|
||||
#include "../../../src/data/device_adapter.cuh"
|
||||
#elif defined(XGBOOST_USE_HIP)
|
||||
#include "../../../src/data/device_adapter.hip.h"
|
||||
#endif
|
||||
|
||||
#include "../helpers.h"
|
||||
#include "test_array_interface.h"
|
||||
#include "../../../src/data/array_interface.h"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user