Skip to content

Commit

Permalink
Add missing HAVE_GPU guards.
Browse files Browse the repository at this point in the history
Signed-off-by: Josh Romero <joshr@nvidia.com>
  • Loading branch information
romerojosh committed Jun 9, 2021
1 parent 73e9077 commit 104485b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions horovod/common/common.h
Expand Up @@ -179,10 +179,12 @@ inline std::string CommunicatorName(Communicator comm) {

struct Event {
Event() = default;
#if HAVE_GPU
Event(std::shared_ptr<gpuEvent_t> event, gpuStream_t stream) :
event(event), stream(stream) {};
std::shared_ptr<gpuEvent_t> event;
gpuStream_t stream = nullptr;
#endif
};


Expand Down Expand Up @@ -275,11 +277,13 @@ class ReadyEventList {
return ready_events_.size();
}

#if HAVE_GPU
void PushEventsToSet(std::unordered_set<gpuEvent_t>& event_set) {
for (auto& e : ready_events_) {
event_set.insert(e->event());
}
}
#endif

~ReadyEventList() = default;

Expand Down

0 comments on commit 104485b

Please sign in to comment.