use __HIPCC__ for device code
This commit is contained in:
@@ -15,10 +15,10 @@
|
||||
#include "../filesystem.h" // dmlc::TemporaryDirectory
|
||||
#include "../helpers.h"
|
||||
|
||||
#if defined(__CUDACC__) || defined(__HIP_PLATFORM_AMD__)
|
||||
#if defined(__CUDACC__) || defined(__HIPCC__)
|
||||
#include <xgboost/json.h>
|
||||
#include "../../../src/data/device_adapter.cuh"
|
||||
#endif // __CUDACC__, __HIP_PLATFORM_AMD__
|
||||
#endif // __CUDACC__, __HIPCC__
|
||||
|
||||
// Some helper functions used to test both GPU and CPU algorithms
|
||||
//
|
||||
@@ -47,7 +47,7 @@ inline std::vector<float> GenerateRandomWeights(int num_rows) {
|
||||
return w;
|
||||
}
|
||||
|
||||
#if defined(__CUDACC__) || defined(__HIP_PLATFORM_AMD__)
|
||||
#if defined(__CUDACC__) || defined(__HIPCC__)
|
||||
inline data::CupyAdapter AdapterFromData(const thrust::device_vector<float> &x,
|
||||
int num_rows, int num_columns) {
|
||||
Json array_interface{Object()};
|
||||
|
||||
@@ -99,7 +99,7 @@ struct TestRBeginREnd {
|
||||
|
||||
Span<float> s (arr);
|
||||
|
||||
#if defined(__CUDA_ARCH__) || defined(__HIP_PLATFORM_AMD__)
|
||||
#if defined(__CUDA_ARCH__) || defined(__HIPCC__)
|
||||
auto rbeg = dh::trbegin(s);
|
||||
auto rend = dh::trend(s);
|
||||
#else
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "../../../src/common/transform.h"
|
||||
#include "../helpers.h"
|
||||
|
||||
#if defined(__CUDACC__) || defined(__HIP_PLATFORM_AMD__)
|
||||
#if defined(__CUDACC__) || defined(__HIPCC__)
|
||||
|
||||
#define TRANSFORM_GPU 0
|
||||
|
||||
@@ -53,7 +53,7 @@ TEST(Transform, DeclareUnifiedTest(Basic)) {
|
||||
ASSERT_TRUE(std::equal(h_sol.begin(), h_sol.end(), res.begin()));
|
||||
}
|
||||
|
||||
#if !defined(__CUDACC__) && !defined(__HIP_PLATFORM_AMD__)
|
||||
#if !defined(__CUDACC__) && !defined(__HIPCC__)
|
||||
TEST(TransformDeathTest, Exception) {
|
||||
size_t const kSize {16};
|
||||
std::vector<bst_float> h_in(kSize);
|
||||
|
||||
Reference in New Issue
Block a user