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

Test updates of CCCL (thrust, cub, libcudacxx) to 2.1.0. #1464

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions conda/recipes/libraft/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ outputs:
- cuda-cudart-dev
{% endif %}
- cuda-version ={{ cuda_version }}
- librmm ={{ minor_version }}
#- librmm ={{ minor_version }} # TODO: Temporarily disabled so that rmm doesn't provide CCCL
- spdlog {{ spdlog_version }}
- fmt {{ fmt_version }}
run:
- {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }}
{% if cuda_major == "11" %}
- cudatoolkit
{% endif %}
- librmm ={{ minor_version }}
#- librmm ={{ minor_version }} # TODO: Temporarily disabled so that rmm doesn't provide CCCL
- spdlog {{ spdlog_version }}
- fmt {{ fmt_version }}
about:
Expand All @@ -92,7 +92,7 @@ outputs:
- cuda-version ={{ cuda_version }}
run:
- {{ pin_subpackage('libraft-headers-only', exact=True) }}
- librmm ={{ minor_version }}
#- librmm ={{ minor_version }} # TODO: Temporarily disabled so that rmm doesn't provide CCCL
- {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }}
{% if cuda_major == "11" %}
- cudatoolkit
Expand Down
21 changes: 12 additions & 9 deletions cpp/include/raft/spectral/detail/matrix_wrappers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include <thrust/reduce.h>
#include <thrust/system/cuda/execution_policy.h>

#include <cuda/functional>

#include <algorithm>

// =========================================================
Expand Down Expand Up @@ -107,15 +109,16 @@ class vector_t {

value_type nrm1() const
{
return thrust::reduce(thrust_policy,
buffer_.data(),
buffer_.data() + buffer_.size(),
value_type{0},
[] __device__(auto left, auto right) {
auto abs_left = left > 0 ? left : -left;
auto abs_right = right > 0 ? right : -right;
return abs_left + abs_right;
});
return thrust::reduce(
thrust_policy,
buffer_.data(),
buffer_.data() + buffer_.size(),
value_type{0},
cuda::proclaim_return_type<value_type>([] __device__(auto left, auto right) {
auto abs_left = left > 0 ? left : -left;
auto abs_right = right > 0 ? right : -right;
return abs_left + abs_right;
}));
}

void fill(value_type value)
Expand Down
8 changes: 8 additions & 0 deletions cpp/test/core/span.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/* TODO: This include of cuda_runtime.h is needed to work around
* https://github.com/NVIDIA/libcudacxx/pull/476
* which is resolved in CCCL 2.2.0. The macro definition order requires CUDA
* headers to be included before libcudacxx headers.
*/
#include <cuda_runtime.h>

#include "test_span.hpp"
#include <gtest/gtest.h>
#include <numeric> // iota
Expand Down
8 changes: 8 additions & 0 deletions cpp/test/core/sparse_matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/* TODO: This include of cuda_runtime.h is needed to work around
* https://github.com/NVIDIA/libcudacxx/pull/476
* which is resolved in CCCL 2.2.0. The macro definition order requires CUDA
* headers to be included before libcudacxx headers.
*/
#include <cuda_runtime.h>

#include <gtest/gtest.h>
#include <raft/core/host_coo_matrix.hpp>
#include <raft/core/host_csr_matrix.hpp>
Expand Down
2 changes: 2 additions & 0 deletions fetch_rapids.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
# =============================================================================
set(rapids-cmake-repo bdice/rapids-cmake)
set(rapids-cmake-branch cccl-update-2.1.0)
if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS.cmake)
file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-24.02/RAPIDS.cmake
${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS.cmake
Expand Down
Loading