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

[REVIEW] Port unary to libcudf++ #3214

Merged
merged 47 commits into from
Nov 27, 2019
Merged
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
14a3f63
[WIP] Port unary to libcudf++
Oct 25, 2019
e919b4b
Merge branch 'branch-0.11' into fea-port-unary
codereport Oct 28, 2019
a83a1c7
[ISSUE] 2950
codereport Oct 28, 2019
08d2154
Merge branch 'branch-0.11' into fea-port-unary
codereport Oct 28, 2019
4e9c944
[WIP] Port unary to libcudf++
codereport Oct 28, 2019
9f39da7
Merge branch 'branch-0.11' into fea-port-unary
codereport Oct 29, 2019
ac250c5
Merge branch 'branch-0.11' into fea-port-unary
codereport Oct 30, 2019
d874e7c
Update cpp/src/unary/math_ops.cu
codereport Oct 31, 2019
587c4f9
Update cpp/src/unary/unary_ops.cuh
codereport Oct 31, 2019
25c5db1
Update cpp/src/unary/unary_ops.cuh
codereport Oct 31, 2019
32e9207
Addressing Mark's comments
codereport Oct 31, 2019
710cad6
Merge branch 'branch-0.11' into fea-port-unary
codereport Oct 31, 2019
856d136
Merge branch 'fea-port-unary' of https://github.com/codereport/cudf i…
codereport Oct 31, 2019
1c5e3fe
Upgrade gpu_op_kernel to thrust::transform
codereport Nov 1, 2019
ed88761
Merge branch 'branch-0.11' into fea-port-unary
codereport Nov 1, 2019
ee58531
Merge remote-tracking branch 'upstream/branch-0.11' into fea-port-unary
codereport Nov 1, 2019
9cfaa1f
Add cast_ops - pre port
codereport Nov 1, 2019
da7c8d5
Merge branch 'fea-port-unary' of https://github.com/codereport/cudf i…
Nov 3, 2019
259fbcd
Merge branch 'branch-0.11' into fea-port-unary
codereport Nov 4, 2019
f3e6859
Merge branch 'branch-0.11' into fea-port-unary
codereport Nov 7, 2019
5529345
Merge branch 'branch-0.11' into fea-port-unary
codereport Nov 18, 2019
54d3624
Merge branch 'branch-0.11' into fea-port-unary
codereport Nov 19, 2019
db5ed94
Merge remote-tracking branch 'origin/fea-port-unary' into fea-port-unary
Nov 19, 2019
11a1968
Remove gdf_error from unary_ops
Nov 19, 2019
b0b122c
Replace gdf_num_bitmask elements with cudf::num_bitmask_words
Nov 19, 2019
5299273
Remove cast_ops and update CMakeLists.txt
Nov 19, 2019
1e078ee
Merge branch 'branch-0.11' into fea-port-unary
Nov 19, 2019
afbd31e
Merge branch 'branch-0.11' into fea-port-unary
Nov 22, 2019
09cecdf
Merge branch 'branch-0.11' into fea-port-unary
Nov 23, 2019
53ae13e
Remove legacy headers from math_ops.cu
Nov 24, 2019
174d3a0
Remove legacy headers from math_ops.cu
Nov 24, 2019
775389b
Merge branch 'fea-port-unary' of https://github.com/codereport/cudf i…
codereport Nov 24, 2019
446bdca
Clean up legacy/unary_ops_test.cu
codereport Nov 24, 2019
2d8fe08
Fix CHANGELOG.md file
codereport Nov 24, 2019
194e2e6
Renaming functions / structs from CR
codereport Nov 24, 2019
dc514c1
Initial unary port tests
codereport Nov 25, 2019
2f6e524
Remove tabs from unary_ops_tests
codereport Nov 25, 2019
317c199
Extra unary ops tests
codereport Nov 25, 2019
789610d
Extra unary ops tests
codereport Nov 25, 2019
067dd12
Merge remote-tracking branch 'origin/fea-port-unary' into fea-port-unary
codereport Nov 25, 2019
fe7ee5e
Small fix and clean up of handle_checks_and_validity
codereport Nov 25, 2019
a1d3c07
Merge branch 'branch-0.11' into fea-port-unary
codereport Nov 25, 2019
feba50b
Responding to CR comments:
codereport Nov 26, 2019
088e3ad
Responding to CR comments:
codereport Nov 26, 2019
480ac5b
Refactor of dispatcher/launcher to return column_view
codereport Nov 26, 2019
870d7a1
Responding to CR comments:
codereport Nov 27, 2019
d931b0a
Merge branch 'branch-0.11' into fea-port-unary
codereport Nov 27, 2019
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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
- PR #3380 Concatenate columns of strings
- PR #3382 Add fill function for strings column
- PR #3391 Move device_atomics_tests.cu files to legacy
- PR #3303 Define and implement new stream compaction APIs `copy_if`, `drop_nulls`,
- PR #3303 Define and implement new stream compaction APIs `copy_if`, `drop_nulls`,
`apply_boolean_mask`, `drop_duplicate` and `unique_count`.
- PR #3387 Strings column gather function
- PR #3440 Strings column scatter function
Expand All @@ -146,6 +146,7 @@
- PR #3425 Strings column copy_if_else implementation
- PR #3422 Move utilities to legacy
- PR #3201 Define and implement new datetime_ops APIs
- PR #3214 Port unary to libcudf++
codereport marked this conversation as resolved.
Show resolved Hide resolved

## Bug Fixes

Expand Down
2 changes: 2 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,8 @@ add_library(cudf
src/unary/legacy/math_ops.cu
src/unary/legacy/cast_ops.cu
src/unary/legacy/null_ops.cu
src/unary/math_ops.cu
src/unary/unary_ops.cuh
src/io/legacy/cuio_common.cpp
src/io/legacy/io_functions.cpp
src/io/convert/csr/legacy/cudf_to_csr.cu
Expand Down
31 changes: 31 additions & 0 deletions cpp/include/cudf/unary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,37 @@
namespace cudf {
namespace experimental {

enum class unary_op {
SIN, // < Trigonometric sine
COS, // < Trigonometric cosine
TAN, // < Trigonometric tangent
ARCSIN, // < Trigonometric sine inverse
ARCCOS, // < Trigonometric cosine inverse
ARCTAN, // < Trigonometric tangent inverse
EXP, // < Exponential (base e, Euler number)
LOG, // < Natural Logarithm (base e)
SQRT, // < Square-root (x^0.5)
CEIL, // < Smallest integer value not less than arg
FLOOR, // < largest integer value not greater than arg
ABS, // < Absolute value
BIT_INVERT, // < Bitwise Not (~)
NOT, // < Logical Not (!)
};

/**
* @brief Performs unary op on all values in column
*
* @param[in] input A `column_view` as input
* @param[in] op operation to perform
*
* @returns std::unique_ptr<cudf::column> Result of the operation
*/
std::unique_ptr<cudf::column> unary_operation(cudf::column_view const& input,
cudf::experimental::unary_op op,
cudaStream_t stream = 0,
codereport marked this conversation as resolved.
Show resolved Hide resolved
rmm::mr::device_memory_resource* mr =
rmm::mr::get_default_resource());

/**
* @brief Creates a column of `BOOL8` elements where for every element in `input` `true`
* indicates the value is null and `false` indicates the value is valid.
Expand Down
15 changes: 5 additions & 10 deletions cpp/include/cudf/utilities/legacy/wrapper_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,17 +350,12 @@ using unwrapped_type_t = typename unwrapped_type<T>::type;

} // namespace detail

using category = detail::wrapper<int32_t, GDF_CATEGORY>;

using category = detail::wrapper<int32_t, GDF_CATEGORY>;
using nvstring_category = detail::wrapper<int32_t, GDF_STRING_CATEGORY>;

using timestamp = detail::wrapper<int64_t, GDF_TIMESTAMP>;

using date32 = detail::wrapper<int32_t, GDF_DATE32>;

using date64 = detail::wrapper<int64_t, GDF_DATE64>;

using bool8 = detail::wrapper<int8_t, GDF_BOOL8>;
using timestamp = detail::wrapper<int64_t, GDF_TIMESTAMP>;
using date32 = detail::wrapper<int32_t, GDF_DATE32>;
using date64 = detail::wrapper<int64_t, GDF_DATE64>;
using bool8 = detail::wrapper<int8_t, GDF_BOOL8>;

// This is necessary for global, constant, non-fundamental types
// We can't rely on --expt-relaxed-constexpr here because `bool8` is not a
Expand Down
Loading