Skip to content

Commit ef36a4d

Browse files
committed
CPU build.
1 parent 1b52da1 commit ef36a4d

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

src/common/cuda_rt_utils.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
*/
44
#include "cuda_rt_utils.h"
55

6+
#include "cuda_stream.h" // for StreamRef
7+
68
#if defined(XGBOOST_USE_CUDA)
79
#include <cuda_runtime_api.h>
810

src/common/cuda_rt_utils.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
#include <cstddef> // for size_t
66
#include <cstdint> // for int32_t
77

8-
#if defined(XGBOOST_USE_CUDA)
9-
#include "cuda_stream.h"
10-
#endif
8+
#include "cuda_stream.h" // for StreamRef
119

1210
namespace xgboost::curt {
1311
std::int32_t AllVisibleGPUs();

src/common/cuda_stream.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@
22
* Copyright 2022-2025, XGBoost contributors
33
*/
44
#pragma once
5+
6+
#if defined(XGBOOST_USE_CUDA)
57
#include <cuda_runtime.h>
8+
#endif // defined(XGBOOST_USE_CUDA)
69

710
#include <memory> // for unique_ptr
811
#include <utility> // for swap
912

1013
#include "common.h"
1114

1215
namespace xgboost::curt {
16+
#if defined(XGBOOST_USE_CUDA)
1317
class StreamRef;
1418

1519
class Event {
@@ -94,4 +98,7 @@ class Stream {
9498
void Sync() { this->View().Sync(); }
9599
void Wait(Event const &e) { this->View().Wait(e); }
96100
};
101+
#else
102+
class StreamRef {};
103+
#endif
97104
} // namespace xgboost::curt

0 commit comments

Comments
 (0)