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

refactor: remove usage of boost is_aligned #3684

Merged
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 2 additions & 10 deletions vowpalwabbit/lda_core.cc
Expand Up @@ -29,14 +29,9 @@
#include "io/logger.h"
#include "shared_data.h"

#include <boost/version.hpp>
#include <boost/math/special_functions/digamma.hpp>
#include <boost/math/special_functions/gamma.hpp>

#if BOOST_VERSION >= 105600
# include <boost/align/is_aligned.hpp>
#endif

using namespace VW::config;
using namespace VW::LEARNER;

Expand Down Expand Up @@ -162,11 +157,8 @@ namespace
{
inline bool is_aligned16(void* ptr)
{
# if BOOST_VERSION >= 105600
return boost::alignment::is_aligned(16, ptr);
# else
return ((reinterpret_cast<uintptr_t>(ptr) & 0x0f) == 0);
# endif
constexpr std::size_t alignment = 16;
return (reinterpret_cast<std::size_t>(ptr) & (alignment - 1)) == 0;
}
} // namespace

Expand Down