Skip to content

Commit

Permalink
Merge branch 'branch-22.02' into dictionary-copy-if-else
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwendt committed Dec 13, 2021
2 parents 8a16204 + d23bcb4 commit c32f625
Show file tree
Hide file tree
Showing 107 changed files with 1,450 additions and 742 deletions.
9 changes: 0 additions & 9 deletions cpp/.clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,6 @@ ForEachMacros:
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^<ext/.*\.h>'
Priority: 2
- Regex: '^<.*\.h>'
Priority: 1
- Regex: '^<.*'
Priority: 2
- Regex: '.*'
Priority: 3
IncludeIsMainRegex: '([-_](test|unittest))?$'
IndentCaseLabels: true
IndentPPDirectives: None
Expand Down
21 changes: 21 additions & 0 deletions cpp/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ add_library(
synchronization/synchronization.cpp io/cuio_benchmark_common.cpp
)
target_link_libraries(cudf_benchmark_common PRIVATE cudf_datagen)
add_custom_command(
OUTPUT CUDF_BENCHMARKS
COMMAND echo Running benchmarks
COMMAND mkdir -p results
VERBATIM
COMMENT "Running cudf benchmarks."
USES_TERMINAL
)

# This function takes in a benchmark name and benchmark source and handles setting all of the
# associated properties and linking to build the benchmark
Expand All @@ -54,6 +62,13 @@ function(ConfigureBench CMAKE_BENCH_NAME)
target_link_libraries(
${CMAKE_BENCH_NAME} PRIVATE cudf_benchmark_common cudf_datagen benchmark::benchmark_main
)
add_custom_command(
OUTPUT CUDF_BENCHMARKS
COMMAND ${CMAKE_BENCH_NAME} --benchmark_out_format=json
--benchmark_out=results/${CMAKE_BENCH_NAME}.json
APPEND
COMMENT "Adding ${CMAKE_BENCH_NAME}"
)
endfunction()

# This function takes in a benchmark name and benchmark source for nvbench benchmarks and handles
Expand Down Expand Up @@ -254,3 +269,9 @@ ConfigureBench(JSON_BENCH string/json_benchmark.cpp)
# ##################################################################################################
# * io benchmark ---------------------------------------------------------------------
ConfigureBench(MULTIBYTE_SPLIT_BENCHMARK io/text/multibyte_split_benchmark.cpp)

add_custom_target(
run_benchmarks
DEPENDS CUDF_BENCHMARKS
COMMENT "Custom command for running cudf benchmarks."
)
2 changes: 1 addition & 1 deletion cpp/benchmarks/transpose/transpose_benchmark.cu
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
* limitations under the License.
*/

#include <thrust/transform.h>
#include <benchmarks/fixture/benchmark_fixture.hpp>
#include <benchmarks/synchronization/synchronization.hpp>
#include <cudf/transpose.hpp>
#include <cudf/types.hpp>
#include <cudf_test/column_wrapper.hpp>
#include <memory>
#include <thrust/transform.h>

using cudf::test::fixed_width_column_wrapper;

Expand Down
91 changes: 91 additions & 0 deletions cpp/include/cudf/datetime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,5 +469,96 @@ std::unique_ptr<column> floor_nanosecond(
column_view const& column,
rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());

/**
* @brief Round to the nearest day
*
* @param column cudf::column_view of the input datetime values
* @param mr Device memory resource used to allocate device memory of the returned column.
*
* @throw cudf::logic_error if input column datatype is not TIMESTAMP
* @return cudf::column of the same datetime resolution as the input column
*/
std::unique_ptr<cudf::column> round_day(
cudf::column_view const& column,
rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());

/**
* @brief Round to the nearest hour
*
* @param column cudf::column_view of the input datetime values
* @param mr Device memory resource used to allocate device memory of the returned column.
*
* @throw cudf::logic_error if input column datatype is not TIMESTAMP
* @return cudf::column of the same datetime resolution as the input column
*/
std::unique_ptr<cudf::column> round_hour(
cudf::column_view const& column,
rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());

/**
* @brief Round to the nearest minute
*
* @param column cudf::column_view of the input datetime values
* @param mr Device memory resource used to allocate device memory of the returned column.
*
* @throw cudf::logic_error if input column datatype is not TIMESTAMP
* @return cudf::column of the same datetime resolution as the input column
*/
std::unique_ptr<cudf::column> round_minute(
cudf::column_view const& column,
rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());

/**
* @brief Round to the nearest second
*
* @param column cudf::column_view of the input datetime values
* @param mr Device memory resource used to allocate device memory of the returned column.
*
* @throw cudf::logic_error if input column datatype is not TIMESTAMP
* @return cudf::column of the same datetime resolution as the input column
*/
std::unique_ptr<cudf::column> round_second(
cudf::column_view const& column,
rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());

/**
* @brief Round to the nearest millisecond
*
* @param column cudf::column_view of the input datetime values
* @param mr Device memory resource used to allocate device memory of the returned column.
*
* @throw cudf::logic_error if input column datatype is not TIMESTAMP
* @return cudf::column of the same datetime resolution as the input column
*/
std::unique_ptr<column> round_millisecond(
column_view const& column,
rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());

/**
* @brief Round to the nearest microsecond
*
* @param column cudf::column_view of the input datetime values
* @param mr Device memory resource used to allocate device memory of the returned column.
*
* @throw cudf::logic_error if input column datatype is not TIMESTAMP
* @return cudf::column of the same datetime resolution as the input column
*/
std::unique_ptr<column> round_microsecond(
column_view const& column,
rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());

/**
* @brief Round to the nearest nanosecond
*
* @param column cudf::column_view of the input datetime values
* @param mr Device memory resource used to allocate device memory of the returned column.
*
* @throw cudf::logic_error if input column datatype is not TIMESTAMP
* @return cudf::column of the same datetime resolution as the input column
*/
std::unique_ptr<column> round_nanosecond(
column_view const& column,
rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());

} // namespace datetime
} // namespace cudf
Loading

0 comments on commit c32f625

Please sign in to comment.