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