-
Notifications
You must be signed in to change notification settings - Fork 309
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'rapidsai:branch-24.06' into basic_tutorial
- Loading branch information
Showing
96 changed files
with
3,482 additions
and
1,029 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
cpp/include/cugraph/mtmg/detail/device_shared_device_span_tuple.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright (c) 2024, NVIDIA CORPORATION. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <cugraph/mtmg/detail/device_shared_wrapper.hpp> | ||
|
||
#include <raft/core/device_span.hpp> | ||
|
||
namespace cugraph { | ||
namespace mtmg { | ||
namespace detail { | ||
|
||
/** | ||
* @brief Manage a tuple of device spans on each GPU | ||
*/ | ||
template <typename... Ts> | ||
using device_shared_device_span_tuple_t = | ||
device_shared_wrapper_t<std::tuple<raft::device_span<Ts>...>>; | ||
|
||
} // namespace detail | ||
} // namespace mtmg | ||
} // namespace cugraph |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
cpp/include/cugraph/mtmg/detail/device_shared_device_vector_tuple.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* Copyright (c) 2024, NVIDIA CORPORATION. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <cugraph/mtmg/detail/device_shared_device_span_tuple.hpp> | ||
|
||
#include <rmm/device_uvector.hpp> | ||
|
||
namespace cugraph { | ||
namespace mtmg { | ||
namespace detail { | ||
|
||
/** | ||
* @brief Manage a tuple of device vector on each GPU | ||
* | ||
* Uses the device_shared_wrapper to manage a tuple of rmm::device_uvector | ||
* instances on each GPU. | ||
*/ | ||
template <typename... Ts> | ||
class device_shared_device_vector_tuple_t | ||
: public device_shared_wrapper_t<std::tuple<rmm::device_uvector<Ts>...>> { | ||
using parent_t = detail::device_shared_wrapper_t<std::tuple<rmm::device_uvector<Ts>...>>; | ||
|
||
public: | ||
/** | ||
* @brief Create a device_shared_device_span (read only view) | ||
*/ | ||
auto view() | ||
{ | ||
std::lock_guard<std::mutex> lock(parent_t::lock_); | ||
|
||
device_shared_device_span_tuple_t<Ts...> result; | ||
|
||
std::for_each(parent_t::objects_.begin(), parent_t::objects_.end(), [&result, this](auto& p) { | ||
convert_to_span(std::index_sequence_for<Ts...>(), result, p); | ||
// std::size_t Is... = std::index_sequence_for<Ts...>; | ||
// result.set(p.first, std::make_tuple(raft::device_span<Ts | ||
// const>{std::get<Is>(p.second).data(), std::get<Is>(p.second).size()}...)); | ||
}); | ||
|
||
return result; | ||
} | ||
|
||
private: | ||
template <std::size_t... Is> | ||
void convert_to_span(std::index_sequence<Is...>, | ||
device_shared_device_span_tuple_t<Ts...>& result, | ||
std::pair<int32_t const, std::tuple<rmm::device_uvector<Ts>...>>& p) | ||
{ | ||
result.set(p.first, | ||
std::make_tuple(raft::device_span<Ts>{std::get<Is>(p.second).data(), | ||
std::get<Is>(p.second).size()}...)); | ||
} | ||
}; | ||
|
||
} // namespace detail | ||
} // namespace mtmg | ||
} // namespace cugraph |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright (c) 2024, NVIDIA CORPORATION. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <cugraph/mtmg/detail/device_shared_device_vector_tuple.hpp> | ||
#include <cugraph/mtmg/vertex_pair_result_view.hpp> | ||
|
||
namespace cugraph { | ||
namespace mtmg { | ||
|
||
/** | ||
* @brief An MTMG device vector for storing vertex results | ||
*/ | ||
template <typename vertex_t, typename result_t> | ||
class vertex_pair_result_t | ||
: public detail::device_shared_device_vector_tuple_t<vertex_t, vertex_t, result_t> { | ||
using parent_t = detail::device_shared_device_vector_tuple_t<vertex_t, vertex_t, result_t>; | ||
|
||
public: | ||
/** | ||
* @brief Create a vertex result view (read only) | ||
*/ | ||
auto view() { return vertex_pair_result_view_t<vertex_t, result_t>(this->parent_t::view()); } | ||
}; | ||
|
||
} // namespace mtmg | ||
} // namespace cugraph |
Oops, something went wrong.