Skip to content

Commit

Permalink
Fix sg benchmark build. (#4766)
Browse files Browse the repository at this point in the history
Fix static storage error:

```
/usr/bin/ld: bench/CMakeFiles/sg_benchmark.dir/sg/arima_loglikelihood.cu.o: in function `ML::Bench::Fixture::SetUp(benchmark::State const&)':
tmpxft_0000bc8b_00000000-6_arima_loglikelihood.cudafe1.cpp:(.text._ZN2ML5Bench7Fixture5SetUpERKN9benchmark5StateE[_ZN2ML5Bench7Fixture5SetUpERKN9benchmark5StateE]+0x2d): undefined reference to `ML::Bench::Fixture::NumStreams'
```

Authors:
  - Jiaming Yuan (https://github.com/trivialfis)

Approvers:
  - Victor Lafargue (https://github.com/viclafargue)
  - Dante Gama Dessavre (https://github.com/dantegd)

URL: #4766
  • Loading branch information
trivialfis authored Jun 2, 2022
1 parent c1b4fbe commit 9cdd8d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cpp/bench/sg/benchmark.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Fixture : public MLCommon::Bench::Fixture {

void SetUp(const ::benchmark::State& state) override
{
auto stream_pool = std::make_shared<rmm::cuda_stream_pool>(NumStreams);
auto stream_pool = std::make_shared<rmm::cuda_stream_pool>(numStreams());
handle.reset(new raft::handle_t{rmm::cuda_stream_per_thread, stream_pool});
MLCommon::Bench::Fixture::SetUp(state);
}
Expand Down Expand Up @@ -88,7 +88,7 @@ class Fixture : public MLCommon::Bench::Fixture {
///@todo: ideally, this should be determined at runtime based on the inputs
/// passed to the fixture. That will require a whole lot of plumbing of
/// interfaces. Thus, as a quick workaround, defining this static var.
static const int NumStreams = 16;
constexpr static std::int32_t numStreams() { return 16; }
}; // end class Fixture

/**
Expand Down

0 comments on commit 9cdd8d0

Please sign in to comment.