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

Fix string to double conversion and row equivalent comparison #7410

Merged
merged 24 commits into from
Mar 2, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7a93e07
Add a benchmark for string <=> floats conversion.
ttnghia Feb 18, 2021
3ea06fb
Fix error and improve the function converting fromn string to float t…
ttnghia Feb 18, 2021
4bfd906
Fix the equivalent check function for floating point numbers that inc…
ttnghia Feb 18, 2021
0cfdbcd
Add a test for converting string to double number
ttnghia Feb 18, 2021
7778f85
Merge remote-tracking branch 'origin/branch-0.19' into branch-0.19-is…
ttnghia Feb 18, 2021
a5ede5d
Update copyright header
ttnghia Feb 18, 2021
2584840
Fix const qualifier position and change CMakeLists.txt
ttnghia Feb 18, 2021
7fadcd0
Some improvement to atof
ttnghia Feb 19, 2021
f3ead3d
Use the results generated from std::stof to test our atof implementation
ttnghia Feb 19, 2021
30e98b3
Add a simple test case
ttnghia Feb 19, 2021
354e65e
Fix convert_floats_benchmark
ttnghia Feb 19, 2021
0130e51
Merge remote-tracking branch 'origin/branch-0.19' into branch-0.19-is…
ttnghia Feb 19, 2021
d411f7f
Merge remote-tracking branch 'origin/branch-0.19' into branch-0.19-is…
ttnghia Feb 20, 2021
8f5a580
Improve accuracy by casting from string to double then to float
ttnghia Feb 20, 2021
a112a1b
Change the template function `stof` to a regular function `stod`.
ttnghia Feb 22, 2021
f8077a7
Re-instating important comment
ttnghia Feb 22, 2021
1238dba
Minor change in handling nan in typed_element_not_equivalent struct
ttnghia Feb 22, 2021
4aaa83f
Simplify data generation and change ranges for the benchmarks
ttnghia Feb 22, 2021
6b1af3b
Merge remote-tracking branch 'origin/branch-0.19' into branch-0.19-is…
ttnghia Feb 23, 2021
3a7c52e
Update header format for cpp/benchmarks/string/convert_floats_benchma…
ttnghia Feb 23, 2021
4fbd4f6
Add a comment to the stod function
ttnghia Mar 1, 2021
0b8633b
Generate random float numbers by calling to create_random_table, and …
ttnghia Mar 1, 2021
886fc57
Fix format check
ttnghia Mar 1, 2021
da19661
Merge branch 'branch-0.19' into branch-0.19-issue-5225
ttnghia Mar 2, 2021
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
103 changes: 52 additions & 51 deletions cpp/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@
#=============================================================================

add_library(cudf_datagen STATIC
"${CMAKE_SOURCE_DIR}/benchmarks/common/generate_benchmark_input.cpp"
)
"${CMAKE_SOURCE_DIR}/benchmarks/common/generate_benchmark_input.cpp"
)

###################################################################################################
# - compiler function -----------------------------------------------------------------------------

set(BENCHMARK_LIST CACHE INTERNAL "BENCHMARK_LIST")

function(ConfigureBench CMAKE_BENCH_NAME CMAKE_BENCH_SRC)
add_executable(${CMAKE_BENCH_NAME}
${CMAKE_BENCH_SRC}
"${CMAKE_CURRENT_SOURCE_DIR}/synchronization/synchronization.cpp"
"${CMAKE_SOURCE_DIR}/tests/utilities/base_fixture.cpp"
"${CMAKE_SOURCE_DIR}/benchmarks/io/cuio_benchmark_common.cpp")
set_target_properties(${CMAKE_BENCH_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_link_libraries(${CMAKE_BENCH_NAME} benchmark benchmark_main pthread cudf_datagen cudf)
set_target_properties(${CMAKE_BENCH_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/gbenchmarks")
set(BENCHMARK_LIST ${BENCHMARK_LIST} ${CMAKE_BENCH_NAME} CACHE INTERNAL "BENCHMARK_LIST")
add_executable(${CMAKE_BENCH_NAME}
${CMAKE_BENCH_SRC}
"${CMAKE_CURRENT_SOURCE_DIR}/synchronization/synchronization.cpp"
"${CMAKE_SOURCE_DIR}/tests/utilities/base_fixture.cpp"
"${CMAKE_SOURCE_DIR}/benchmarks/io/cuio_benchmark_common.cpp")
set_target_properties(${CMAKE_BENCH_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_link_libraries(${CMAKE_BENCH_NAME} benchmark benchmark_main pthread cudf_datagen cudf)
set_target_properties(${CMAKE_BENCH_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/gbenchmarks")
set(BENCHMARK_LIST ${BENCHMARK_LIST} ${CMAKE_BENCH_NAME} CACHE INTERNAL "BENCHMARK_LIST")
endfunction(ConfigureBench)

###################################################################################################
Expand All @@ -44,7 +44,7 @@ include_directories("${THRUST_INCLUDE_DIR}"
"${LIBCUDACXX_INCLUDE_DIR}")

if(CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES)
include_directories("${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}")
include_directories("${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}")
endif(CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES)

include_directories("${CMAKE_BINARY_DIR}/include"
Expand Down Expand Up @@ -76,239 +76,240 @@ link_directories("${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES}" # CMAKE_CUDA_IMPLICIT
# - column benchmarks -----------------------------------------------------------------------------

set(COLUMN_CONCAT_BENCH_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/column/concatenate_benchmark.cpp")
"${CMAKE_CURRENT_SOURCE_DIR}/column/concatenate_benchmark.cpp")

ConfigureBench(COLUMN_CONCAT_BENCH "${COLUMN_CONCAT_BENCH_SRC}")

###################################################################################################
# - gather benchmark ------------------------------------------------------------------------------

set(GATHER_BENCH_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/copying/gather_benchmark.cu")
"${CMAKE_CURRENT_SOURCE_DIR}/copying/gather_benchmark.cu")

ConfigureBench(GATHER_BENCH "${GATHER_BENCH_SRC}")

###################################################################################################
# - scatter benchmark -----------------------------------------------------------------------------

set(SCATTER_BENCH_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/copying/scatter_benchmark.cu")
"${CMAKE_CURRENT_SOURCE_DIR}/copying/scatter_benchmark.cu")

ConfigureBench(SCATTER_BENCH "${SCATTER_BENCH_SRC}")

###################################################################################################
# - contiguous_split benchmark -------------------------------------------------------------------

set(CONTIGUOUS_SPLIT_BENCH_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/copying/contiguous_split_benchmark.cu")
"${CMAKE_CURRENT_SOURCE_DIR}/copying/contiguous_split_benchmark.cu")

ConfigureBench(CONTIGUOUS_SPLIT_BENCH "${CONTIGUOUS_SPLIT_BENCH_SRC}")

###################################################################################################
# - shift benchmark -------------------------------------------------------------------------------

set(SHIFT_BENCH_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/copying/shift_benchmark.cu")
"${CMAKE_CURRENT_SOURCE_DIR}/copying/shift_benchmark.cu")

ConfigureBench(SHIFT_BENCH "${SHIFT_BENCH_SRC}")

###################################################################################################
# - transpose benchmark ---------------------------------------------------------------------------

set(TRANSPOSE_BENCH_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/transpose/transpose_benchmark.cu")
"${CMAKE_CURRENT_SOURCE_DIR}/transpose/transpose_benchmark.cu")

ConfigureBench(TRANSPOSE_BENCH "${TRANSPOSE_BENCH_SRC}")

###################################################################################################
# - apply_boolean_mask benchmark ------------------------------------------------------------------

set(APPLY_BOOLEAN_MASK_BENCH_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/stream_compaction/apply_boolean_mask_benchmark.cpp")
"${CMAKE_CURRENT_SOURCE_DIR}/stream_compaction/apply_boolean_mask_benchmark.cpp")

ConfigureBench(APPLY_BOOLEAN_MASK_BENCH "${APPLY_BOOLEAN_MASK_BENCH_SRC}")

###################################################################################################
# - stream_compaction benchmark -------------------------------------------------------------------

set(STREAM_COMPACTION_BENCH_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/stream_compaction/drop_duplicates_benchmark.cpp")
"${CMAKE_CURRENT_SOURCE_DIR}/stream_compaction/drop_duplicates_benchmark.cpp")

ConfigureBench(STREAM_COMPACTION_BENCH "${STREAM_COMPACTION_BENCH_SRC}")

###################################################################################################
# - join benchmark --------------------------------------------------------------------------------

set(JOIN_BENCH_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/join/join_benchmark.cu")
"${CMAKE_CURRENT_SOURCE_DIR}/join/join_benchmark.cu")

ConfigureBench(JOIN_BENCH "${JOIN_BENCH_SRC}")

###################################################################################################
# - iterator benchmark ----------------------------------------------------------------------------

set(ITERATOR_BENCH_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/iterator/iterator_benchmark.cu")
"${CMAKE_CURRENT_SOURCE_DIR}/iterator/iterator_benchmark.cu")

ConfigureBench(ITERATOR_BENCH "${ITERATOR_BENCH_SRC}")

###################################################################################################
# - search benchmark ------------------------------------------------------------------------------

set(SEARCH_BENCH_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/search/search_benchmark.cu")
"${CMAKE_CURRENT_SOURCE_DIR}/search/search_benchmark.cu")

ConfigureBench(SEARCH_BENCH "${SEARCH_BENCH_SRC}")

###################################################################################################
# - sort benchmark --------------------------------------------------------------------------------

set(SORT_BENCH_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/sort/sort_benchmark.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/sort/sort_strings_benchmark.cpp")
"${CMAKE_CURRENT_SOURCE_DIR}/sort/sort_benchmark.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/sort/sort_strings_benchmark.cpp")

ConfigureBench(SORT_BENCH "${SORT_BENCH_SRC}")

###################################################################################################
# - type_dispatcher benchmark ---------------------------------------------------------------------

set(TD_BENCH_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/type_dispatcher/type_dispatcher_benchmark.cu")
"${CMAKE_CURRENT_SOURCE_DIR}/type_dispatcher/type_dispatcher_benchmark.cu")

ConfigureBench(TYPE_DISPATCHER_BENCH "${TD_BENCH_SRC}")

###################################################################################################
# - reduction benchmark ---------------------------------------------------------------------------

set(REDUCTION_BENCH_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/reduction/anyall_benchmark.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/reduction/dictionary_benchmark.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/reduction/reduce_benchmark.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/reduction/minmax_benchmark.cpp")
"${CMAKE_CURRENT_SOURCE_DIR}/reduction/anyall_benchmark.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/reduction/dictionary_benchmark.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/reduction/reduce_benchmark.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/reduction/minmax_benchmark.cpp")

ConfigureBench(REDUCTION_BENCH "${REDUCTION_BENCH_SRC}")

###################################################################################################
# - groupby benchmark -----------------------------------------------------------------------------

set(GROUPBY_BENCH_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/groupby/group_sum_benchmark.cu"
"${CMAKE_CURRENT_SOURCE_DIR}/groupby/group_nth_benchmark.cu")
"${CMAKE_CURRENT_SOURCE_DIR}/groupby/group_sum_benchmark.cu"
"${CMAKE_CURRENT_SOURCE_DIR}/groupby/group_nth_benchmark.cu")

ConfigureBench(GROUPBY_BENCH "${GROUPBY_BENCH_SRC}")

###################################################################################################
# - hashing benchmark -----------------------------------------------------------------------------

set(HASHING_BENCH_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/hashing/hashing_benchmark.cpp")
"${CMAKE_CURRENT_SOURCE_DIR}/hashing/hashing_benchmark.cpp")

ConfigureBench(HASHING_BENCH "${HASHING_BENCH_SRC}")

###################################################################################################
# - merge benchmark -------------------------------------------------------------------------------

set(MERGE_BENCH_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/merge/merge_benchmark.cpp")
"${CMAKE_CURRENT_SOURCE_DIR}/merge/merge_benchmark.cpp")

ConfigureBench(MERGE_BENCH "${MERGE_BENCH_SRC}")

###################################################################################################
# - null_mask benchmark ---------------------------------------------------------------------------

set(NULLMASK_BENCH_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/null_mask/set_null_mask_benchmark.cpp")
"${CMAKE_CURRENT_SOURCE_DIR}/null_mask/set_null_mask_benchmark.cpp")

ConfigureBench(NULLMASK_BENCH "${NULLMASK_BENCH_SRC}")

###################################################################################################
# - parquet writer chunks benchmark ---------------------------------------------------------------

set(PARQUET_WRITER_CHUNKS_BENCH_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/io/parquet/parquet_writer_chunks_benchmark.cpp")
"${CMAKE_CURRENT_SOURCE_DIR}/io/parquet/parquet_writer_chunks_benchmark.cpp")

ConfigureBench(PARQUET_WRITER_CHUNKS_BENCH "${PARQUET_WRITER_CHUNKS_BENCH_SRC}")

###################################################################################################
# - parquet reader benchmark ----------------------------------------------------------------------

set(PARQUET_READER_BENCH_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/io/parquet/parquet_reader_benchmark.cpp")
"${CMAKE_CURRENT_SOURCE_DIR}/io/parquet/parquet_reader_benchmark.cpp")

ConfigureBench(PARQUET_READER_BENCH "${PARQUET_READER_BENCH_SRC}")

###################################################################################################
# - orc reader benchmark --------------------------------------------------------------------------

set(ORC_READER_BENCH_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/io/orc/orc_reader_benchmark.cpp")
"${CMAKE_CURRENT_SOURCE_DIR}/io/orc/orc_reader_benchmark.cpp")

ConfigureBench(ORC_READER_BENCH "${ORC_READER_BENCH_SRC}")

###################################################################################################
# - csv reader benchmark --------------------------------------------------------------------------

set(CSV_READER_BENCH_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/io/csv/csv_reader_benchmark.cpp")
"${CMAKE_CURRENT_SOURCE_DIR}/io/csv/csv_reader_benchmark.cpp")

ConfigureBench(CSV_READER_BENCH "${CSV_READER_BENCH_SRC}")

###################################################################################################
# - parquet writer benchmark ----------------------------------------------------------------------

set(PARQUET_WRITER_BENCH_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/io/parquet/parquet_writer_benchmark.cpp")
"${CMAKE_CURRENT_SOURCE_DIR}/io/parquet/parquet_writer_benchmark.cpp")

ConfigureBench(PARQUET_WRITER_BENCH "${PARQUET_WRITER_BENCH_SRC}")

###################################################################################################
# - orc writer benchmark --------------------------------------------------------------------------

set(ORC_WRITER_BENCH_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/io/orc/orc_writer_benchmark.cpp")
"${CMAKE_CURRENT_SOURCE_DIR}/io/orc/orc_writer_benchmark.cpp")

ConfigureBench(ORC_WRITER_BENCH "${ORC_WRITER_BENCH_SRC}")

###################################################################################################
# - csv writer benchmark --------------------------------------------------------------------------

set(CSV_WRITER_BENCH_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/io/csv/csv_writer_benchmark.cpp")
"${CMAKE_CURRENT_SOURCE_DIR}/io/csv/csv_writer_benchmark.cpp")

ConfigureBench(CSV_WRITER_BENCH "${CSV_WRITER_BENCH_SRC}")

###################################################################################################
# - ast benchmark ---------------------------------------------------------------------------------

set(AST_BENCH_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/ast/transform_benchmark.cpp")
"${CMAKE_CURRENT_SOURCE_DIR}/ast/transform_benchmark.cpp")

ConfigureBench(AST_BENCH "${AST_BENCH_SRC}")

###################################################################################################
# - binaryop benchmark ----------------------------------------------------------------------------

set(BINARYOP_BENCH_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/binaryop/binaryop_benchmark.cu")
"${CMAKE_CURRENT_SOURCE_DIR}/binaryop/binaryop_benchmark.cu")

ConfigureBench(BINARYOP_BENCH "${BINARYOP_BENCH_SRC}")

###################################################################################################
# - subword tokenizer benchmark -------------------------------------------------------------------

set(SUBWORD_TOKENIZER_BENCH_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/text/subword_benchmark.cpp")
"${CMAKE_CURRENT_SOURCE_DIR}/text/subword_benchmark.cpp")

ConfigureBench(SUBWORD_TOKENIZER_BENCH "${SUBWORD_TOKENIZER_BENCH_SRC}")

###################################################################################################
# - strings benchmark -------------------------------------------------------------------

set(STRINGS_BENCH_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/string/case_benchmark.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/string/contains_benchmark.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/string/convert_durations_benchmark.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/string/replace_scalar_benchmark.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/string/url_decode_benchmark.cpp")
"${CMAKE_CURRENT_SOURCE_DIR}/string/case_benchmark.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/string/contains_benchmark.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/string/convert_durations_benchmark.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/string/convert_floats_benchmark.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/string/replace_scalar_benchmark.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/string/url_decode_benchmark.cpp")

ConfigureBench(STRINGS_BENCH "${STRINGS_BENCH_SRC}")
Loading