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

Fix various build errors #1152

Merged
merged 6 commits into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix various build errors
  • Loading branch information
hcho3 committed Jan 18, 2023
commit 576d0e7b4d000232a416a67c979052ed187dcc9c
1 change: 1 addition & 0 deletions cpp/bench/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ function(ConfigureBench)
PRIVATE raft::raft
$<$<BOOL:${ConfigureBench_DIST}>:raft::distance>
$<$<BOOL:${ConfigureBench_NN}>:raft::nn>
GTest::gtest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The benchmark shouldn't depend on gtest. I think, we should try to break the offending dependency instead (which is not so trivial).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...Or maybe we could live with the gtest dependency in benchmarks while we solve the problem with the header dependencies? Any thoughts, @cjnolet ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

100% agreed w/ @achirkin here. I was going to type up a similar comment but he beat me to it!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The benchmark shouldn't depend on gtest. I think, we should try to break the offending dependency instead (which is not so trivial).

My previous comment was in response to this, btw. I don't think we should be crossing the gtest and benchmark dependencies. We should try and pull out the shared bits into a separate header (and maybe try to find a good place in the include/raft/?) for the shared bits but keep gtest-specific things in test and benchmark-specific things in bench.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also okay opening a github issue about this and keeping the gtest dependency in here for now but adding a comment here that references the issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened #1153

benchmark::benchmark
Threads::Threads
$<TARGET_NAME_IF_EXISTS:OpenMP::OpenMP_CXX>
Expand Down
3 changes: 2 additions & 1 deletion cpp/include/raft/core/device_mdspan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ auto make_device_aligned_matrix_view(ElementType* ptr, IndexType n_rows, IndexTy
detail::alignment::value>::data_handle_type;
static_assert(std::is_same<LayoutPolicy, layout_left_padded<ElementType>>::value ||
std::is_same<LayoutPolicy, layout_right_padded<ElementType>>::value);
assert(ptr == alignTo(ptr, detail::alignment::value));
assert(reinterpret_cast<std::uintptr_t>(ptr)
== std::experimental::details::alignTo(reinterpret_cast<std::uintptr_t>(ptr), detail::alignment::value));

data_handle_type aligned_pointer = ptr;

Expand Down
3 changes: 2 additions & 1 deletion cpp/include/raft/core/host_mdspan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ auto make_host_aligned_matrix_view(ElementType* ptr, IndexType n_rows, IndexType

static_assert(std::is_same<LayoutPolicy, layout_left_padded<ElementType>>::value ||
std::is_same<LayoutPolicy, layout_right_padded<ElementType>>::value);
assert(ptr == alignTo(ptr, detail::alignment::value));
assert(reinterpret_cast<std::uintptr_t>(ptr)
== std::experimental::details::alignTo(reinterpret_cast<std::uintptr_t>(ptr), detail::alignment::value));
data_handle_type aligned_pointer = ptr;

matrix_extent<IndexType> extents{n_rows, n_cols};
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/raft/matrix/detail/linewise_op.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ struct MatrixLinewiseOp {
"layout for in and out must be either padded row or col major");

// also statically assert padded matrix alignment == 2^i*VecBytes
assert(raft::Pow2<VecBytes>::areSameAlignOffsets(in, out));
assert(raft::Pow2<VecBytes>::areSameAlignOffsets(in.data_handle(), out.data_handle()));

if (alongLines)
return matrixLinewiseVecRowsSpan<Type,
Expand Down