Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/branch-21.10' into refactor/remo…
Browse files Browse the repository at this point in the history
…ve_copy_construct
  • Loading branch information
vyasr committed Aug 8, 2021
2 parents aecfb6b + a4eabf0 commit 2fdaccf
Show file tree
Hide file tree
Showing 59 changed files with 2,197 additions and 1,967 deletions.
2 changes: 1 addition & 1 deletion conda/recipes/libcudf/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ test:
- test -f $PREFIX/lib/libcudf.so
- test -f $PREFIX/lib/libcudftestutil.a
- test -f $PREFIX/include/cudf/aggregation.hpp
- test -f $PREFIX/include/cudf/ast/transform.hpp
- test -f $PREFIX/include/cudf/ast/detail/expression_parser.hpp
- test -f $PREFIX/include/cudf/ast/detail/operators.hpp
- test -f $PREFIX/include/cudf/ast/nodes.hpp
Expand Down Expand Up @@ -102,6 +101,7 @@ test:
- test -f $PREFIX/include/cudf/detail/utilities/integer_utils.hpp
- test -f $PREFIX/include/cudf/detail/utilities/int_fastdiv.h
- test -f $PREFIX/include/cudf/detail/utilities/vector_factories.hpp
- test -f $PREFIX/include/cudf/detail/utilities/visitor_overload.hpp
- test -f $PREFIX/include/cudf/dictionary/detail/concatenate.hpp
- test -f $PREFIX/include/cudf/dictionary/detail/encode.hpp
- test -f $PREFIX/include/cudf/dictionary/detail/merge.hpp
Expand Down
3 changes: 2 additions & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ add_library(cudf
src/aggregation/aggregation.cu
src/aggregation/result_cache.cpp
src/ast/expression_parser.cpp
src/ast/transform.cu
src/binaryop/binaryop.cpp
src/binaryop/compiled/binary_ops.cu
src/binaryop/compiled/Add.cu
Expand Down Expand Up @@ -305,6 +304,7 @@ add_library(cudf
src/join/cross_join.cu
src/join/hash_join.cu
src/join/join.cu
src/join/join_utils.cu
src/join/semi_join.cu
src/lists/contains.cu
src/lists/combine/concatenate_list_elements.cu
Expand Down Expand Up @@ -436,6 +436,7 @@ add_library(cudf
src/text/subword/wordpiece_tokenizer.cu
src/text/tokenize.cu
src/transform/bools_to_mask.cu
src/transform/compute_column.cu
src/transform/encode.cu
src/transform/mask_to_bools.cu
src/transform/nans_to_nulls.cu
Expand Down
4 changes: 2 additions & 2 deletions cpp/benchmarks/ast/transform_benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*/

#include <cudf/ast/transform.hpp>
#include <cudf/column/column_factories.hpp>
#include <cudf/table/table.hpp>
#include <cudf/table/table_view.hpp>
#include <cudf/transform.hpp>
#include <cudf/types.hpp>
#include <cudf/utilities/error.hpp>

Expand Down Expand Up @@ -119,7 +119,7 @@ static void BM_ast_transform(benchmark::State& state)
// Execute benchmark
for (auto _ : state) {
cuda_event_timer raii(state, true); // flush_l2_cache = true, stream = 0
cudf::ast::compute_column(table, expression_tree_root);
cudf::compute_column(table, expression_tree_root);
}

// Use the number of bytes read from global memory
Expand Down
10 changes: 5 additions & 5 deletions cpp/include/cudf/ast/detail/expression_evaluator.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,13 @@ struct mutable_column_expression_result
};

/**
* @brief Despite to a binary operator based on a single data type.
* @brief Dispatch to a binary operator based on a single data type.
*
* This functor is a dispatcher for binary operations that assumes that both
* operands to a binary operation are of the same type. This assumption is
* encoded in the one non-deducible template parameter LHS, the type of the
* left-hand operand, which is then used as the template parameter for both the
* left and right operands to the binary operator f.
* operands are of the same type. This assumption is encoded in the
* non-deducible template parameter LHS, the type of the left-hand operand,
* which is then used as the template parameter for both the left and right
* operands to the binary operator f.
*/
struct single_dispatch_binary_operator {
/**
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/cudf/ast/detail/expression_parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace ast {
namespace detail {

/**
* @brief Enum defining data reference types used by a node.
* @brief Node data reference types.
*
* This enum is device-specific. For instance, intermediate data references are generated by the
* linearization process but cannot be explicitly created by the user.
Expand Down
61 changes: 0 additions & 61 deletions cpp/include/cudf/ast/detail/transform.cuh

This file was deleted.

43 changes: 0 additions & 43 deletions cpp/include/cudf/ast/transform.hpp

This file was deleted.

15 changes: 15 additions & 0 deletions cpp/include/cudf/datetime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,21 @@ std::unique_ptr<cudf::column> is_leap_year(
cudf::column_view const& column,
rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());

/**
* @brief Extract the number of days in the month
*
* output[i] contains the number of days in the month of date `column[i]`
* output[i] is null if `column[i]` is null
*
* @throw cudf::logic_error if input column datatype is not a TIMESTAMP
*
* @param cudf::column_view of the input datetime values
* @return cudf::column of datatype INT16 of days in month of the corresponding date
*/
std::unique_ptr<cudf::column> days_in_month(
cudf::column_view const& column,
rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());

/**
* @brief Returns the quarter of the date
*
Expand Down
12 changes: 12 additions & 0 deletions cpp/include/cudf/detail/transform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#pragma once

#include <cudf/ast/nodes.hpp>
#include <cudf/transform.hpp>

#include <rmm/cuda_stream_view.hpp>
Expand All @@ -35,6 +36,17 @@ std::unique_ptr<column> transform(
rmm::cuda_stream_view stream = rmm::cuda_stream_default,
rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());

/**
* @copydoc cudf::compute_column
*
* @param stream CUDA stream used for device memory operations and kernel launches.
*/
std::unique_ptr<column> compute_column(
table_view const table,
ast::expression const& expr,
rmm::cuda_stream_view stream = rmm::cuda_stream_default,
rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());

/**
* @copydoc cudf::nans_to_nulls
*
Expand Down
30 changes: 30 additions & 0 deletions cpp/include/cudf/detail/utilities/visitor_overload.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) 2021, 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

namespace cudf::detail {

/**
* @brief Helper class to support inline-overloading for all of a variant's alternative types
*/
template <class... Ts>
struct visitor_overload : Ts... {
using Ts::operator()...;
};
template <class... Ts>
visitor_overload(Ts...) -> visitor_overload<Ts...>;

} // namespace cudf::detail
Loading

0 comments on commit 2fdaccf

Please sign in to comment.