Skip to content

Commit

Permalink
Partial refactor following Vyas
Browse files Browse the repository at this point in the history
Move direction/order to runtime dispatch
  • Loading branch information
wence- committed Feb 24, 2025
1 parent bb09793 commit fec5788
Show file tree
Hide file tree
Showing 6 changed files with 332 additions and 310 deletions.
20 changes: 1 addition & 19 deletions cpp/include/cudf/detail/rolling.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,28 +103,10 @@ std::unique_ptr<column> rolling_window(column_view const& input,
* launches.
* @param mr Device memory resource used for allocations.
*/
template <rolling::direction Direction>
[[nodiscard]] std::unique_ptr<column> make_range_window(
column_view const& orderby,
std::optional<rolling::preprocessed_group_info> const& grouping,
order order,
null_order null_order,
range_window_type window,
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr);

extern template std::unique_ptr<column> make_range_window<rolling::direction::PRECEDING>(
column_view const& orderby,
std::optional<rolling::preprocessed_group_info> const& grouping,
order order,
null_order null_order,
range_window_type window,
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr);

extern template std::unique_ptr<column> make_range_window<rolling::direction::FOLLOWING>(
column_view const& orderby,
std::optional<rolling::preprocessed_group_info> const& grouping,
rolling::direction direction,
order order,
null_order null_order,
range_window_type window,
Expand Down
42 changes: 21 additions & 21 deletions cpp/src/rolling/detail/range_following.cu
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,30 @@
* limitations under the License.
*/

#include "range_utils.cuh"
// #include "range_utils.cuh"

#include <cudf/column/column.hpp>
#include <cudf/column/column_view.hpp>
#include <cudf/detail/rolling.hpp>
#include <cudf/rolling.hpp>
#include <cudf/types.hpp>
// #include <cudf/column/column.hpp>
// #include <cudf/column/column_view.hpp>
// #include <cudf/detail/rolling.hpp>
// #include <cudf/rolling.hpp>
// #include <cudf/types.hpp>

#include <rmm/cuda_stream_view.hpp>
#include <rmm/resource_ref.hpp>
// #include <rmm/cuda_stream_view.hpp>
// #include <rmm/resource_ref.hpp>

#include <optional>
// #include <optional>

namespace CUDF_EXPORT cudf {
namespace detail {
// namespace CUDF_EXPORT cudf {
// namespace detail {

template std::unique_ptr<column> make_range_window<rolling::direction::FOLLOWING>(
column_view const& orderby,
std::optional<rolling::preprocessed_group_info> const& grouping,
order order,
null_order null_order,
range_window_type window,
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr);
// template std::unique_ptr<column> make_range_window<rolling::direction::FOLLOWING>(
// column_view const& orderby,
// std::optional<rolling::preprocessed_group_info> const& grouping,
// order order,
// null_order null_order,
// range_window_type window,
// rmm::cuda_stream_view stream,
// rmm::device_async_resource_ref mr);

} // namespace detail
} // namespace CUDF_EXPORT cudf
// } // namespace detail
// } // namespace CUDF_EXPORT cudf
42 changes: 21 additions & 21 deletions cpp/src/rolling/detail/range_preceding.cu
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,30 @@
* limitations under the License.
*/

#include "range_utils.cuh"
// #include "range_utils.cuh"

#include <cudf/column/column.hpp>
#include <cudf/column/column_view.hpp>
#include <cudf/detail/rolling.hpp>
#include <cudf/rolling.hpp>
#include <cudf/types.hpp>
// #include <cudf/column/column.hpp>
// #include <cudf/column/column_view.hpp>
// #include <cudf/detail/rolling.hpp>
// #include <cudf/rolling.hpp>
// #include <cudf/types.hpp>

#include <rmm/cuda_stream_view.hpp>
#include <rmm/resource_ref.hpp>
// #include <rmm/cuda_stream_view.hpp>
// #include <rmm/resource_ref.hpp>

#include <optional>
// #include <optional>

namespace CUDF_EXPORT cudf {
namespace detail {
// namespace CUDF_EXPORT cudf {
// namespace detail {

template std::unique_ptr<column> make_range_window<rolling::direction::PRECEDING>(
column_view const& orderby,
std::optional<rolling::preprocessed_group_info> const& grouping,
order order,
null_order null_order,
range_window_type window,
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr);
// template std::unique_ptr<column> make_range_window<rolling::direction::PRECEDING>(
// column_view const& orderby,
// std::optional<rolling::preprocessed_group_info> const& grouping,
// order order,
// null_order null_order,
// range_window_type window,
// rmm::cuda_stream_view stream,
// rmm::device_async_resource_ref mr);

} // namespace detail
} // namespace CUDF_EXPORT cudf
// } // namespace detail
// } // namespace CUDF_EXPORT cudf
Loading

0 comments on commit fec5788

Please sign in to comment.