Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cmake warning] Calling host function from device function in SymbolBits #5462

Closed
SteveBronder opened this issue Mar 31, 2020 · 1 comment · Fixed by #5453
Closed

[cmake warning] Calling host function from device function in SymbolBits #5462

SteveBronder opened this issue Mar 31, 2020 · 1 comment · Fixed by #5453

Comments

@SteveBronder
Copy link

Summary

When compiling from master I'm seeing the warning

src/data/../common/compressed_iterator.h(37): warning: 
  calling a __host__ function from a __host__ __device__ function is not allowed

This seems to come from compressed_iterator.h

inline XGBOOST_DEVICE size_t SymbolBits(size_t num_symbols) {
  auto bits = std::ceil(log2(static_cast<double>(num_symbols)));
  return std::max(static_cast<size_t>(bits), size_t(1));
}

You include cmath at the top so I think this can be

inline XGBOOST_DEVICE size_t SymbolBits(size_t num_symbols) {
  auto bits = ceil(log2(static_cast<double>(num_symbols)));
  return max(static_cast<size_t>(bits), size_t(1));
}

Reproduce

git clone --recursive https://github.com/dmlc/xgboost
mkdir build
cd build
cmake .. -DUSE_CUDA=ON
make # wait for around 77%

I'm using gcc 8.3 though I'm guessing this is an everything thing

@trivialfis
Copy link
Member

Fixed in #5453

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants