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] Update to official libcu++ on Github #6275

Merged
merged 32 commits into from
Dec 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
2e362e8
update to official libcu++ on github
trxcllnt Sep 20, 2020
efb6edb
changelog
trxcllnt Sep 20, 2020
71d1784
update simt references in benchmarks
trxcllnt Sep 20, 2020
496c4eb
Merge branch 'branch-0.16' of github.com:rapidsai/cudf into upgrade-l…
trxcllnt Sep 22, 2020
4587ff7
Merge branch 'branch-0.16' of github.com:rapidsai/cudf into upgrade-l…
trxcllnt Sep 22, 2020
f17b02c
get jitify working with libcu++
trxcllnt Sep 23, 2020
3792923
Merge branch 'branch-0.16' of github.com:rapidsai/cudf into upgrade-l…
trxcllnt Sep 23, 2020
8056f17
fix span_tests.cu includes
trxcllnt Sep 23, 2020
befb135
fix span_tests.cu includes
trxcllnt Sep 23, 2020
bb1d55a
Merge branch 'branch-0.16' of github.com:rapidsai/cudf into upgrade-l…
trxcllnt Sep 23, 2020
d0f91e7
Merge branch 'branch-0.16' of github.com:rapidsai/cudf into upgrade-l…
trxcllnt Sep 24, 2020
8364f42
Merge branch 'branch-0.17' into upgrade-libcu++
trxcllnt Oct 9, 2020
2992282
Merge branch 'upgrade-libcu++' of github.com:trxcllnt/cudf into upgra…
trxcllnt Oct 9, 2020
c7bbbec
update new simt -> cuda references
trxcllnt Oct 9, 2020
659d2ed
Merge branch 'branch-0.16' of github.com:rapidsai/cudf into upgrade-l…
trxcllnt Oct 13, 2020
d9009d9
Merge branch 'branch-0.16' of github.com:rapidsai/cudf into upgrade-l…
trxcllnt Oct 13, 2020
f436073
Merge branch 'branch-0.17' of github.com:rapidsai/cudf into upgrade-l…
trxcllnt Oct 13, 2020
31f6946
Merge branch 'branch-0.17' of github.com:rapidsai/cudf into upgrade-l…
trxcllnt Oct 14, 2020
2b61450
Merge branch 'branch-0.17' of github.com:rapidsai/cudf into upgrade-l…
trxcllnt Oct 21, 2020
eaf5a95
Merge branch 'branch-0.17' of github.com:rapidsai/cudf into upgrade-l…
trxcllnt Nov 20, 2020
d485391
remove unnecessary include
trxcllnt Nov 20, 2020
c28da70
Merge branch 'branch-0.17' of github.com:rapidsai/cudf into upgrade-l…
trxcllnt Nov 23, 2020
0c0babf
update simt -> cuda
trxcllnt Nov 23, 2020
04c7b54
Merge branch 'branch-0.17' of github.com:rapidsai/cudf into upgrade-l…
trxcllnt Nov 23, 2020
4e0c733
Merge branch 'branch-0.17' of github.com:rapidsai/cudf into upgrade-l…
trxcllnt Nov 23, 2020
c2372a4
Merge branch 'branch-0.17' of github.com:rapidsai/cudf into upgrade-l…
trxcllnt Nov 24, 2020
61296b9
Update libcu++ git tag to 1.4.0
trxcllnt Dec 4, 2020
e355a2e
Merge branch 'branch-0.18' of github.com:rapidsai/cudf into upgrade-l…
trxcllnt Dec 8, 2020
85f29e4
move changelog entry
trxcllnt Dec 8, 2020
beaa827
Fix quoted includes
trxcllnt Dec 8, 2020
9d4e254
fix lint
trxcllnt Dec 8, 2020
98fb652
Merge branch 'branch-0.18' of github.com:rapidsai/cudf into upgrade-l…
trxcllnt Dec 8, 2020
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

## Improvements

- PR #6275 Update to official libcu++ on Github
- PR #6838 Fix `columns` & `index` handling in dataframe constructor

## Bug Fixes
Expand Down
186 changes: 102 additions & 84 deletions cpp/CMakeLists.txt

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions cpp/benchmarks/common/generate_benchmark_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ struct random_value_fn<T, typename std::enable_if_t<cudf::is_chrono<T>()>> {

random_value_fn(distribution_params<T> params)
{
using simt::std::chrono::duration_cast;
using cuda::std::chrono::duration_cast;

std::pair<cudf::duration_s, cudf::duration_s> const range_s = {
duration_cast<simt::std::chrono::seconds>(typename T::duration{params.lower_bound}),
duration_cast<simt::std::chrono::seconds>(typename T::duration{params.upper_bound})};
duration_cast<cuda::std::chrono::seconds>(typename T::duration{params.lower_bound}),
duration_cast<cuda::std::chrono::seconds>(typename T::duration{params.upper_bound})};
if (range_s.first != range_s.second) {
seconds_gen =
make_distribution<int64_t>(params.id, range_s.first.count(), range_s.second.count());
Expand All @@ -149,7 +149,7 @@ struct random_value_fn<T, typename std::enable_if_t<cudf::is_chrono<T>()>> {
auto const timestamp_ns =
cudf::duration_s{seconds_gen(engine)} + cudf::duration_ns{nanoseconds_gen(engine)};
// Return value in the type's precision
return T(simt::std::chrono::duration_cast<typename T::duration>(timestamp_ns));
return T(cuda::std::chrono::duration_cast<typename T::duration>(timestamp_ns));
}
};

Expand Down
4 changes: 2 additions & 2 deletions cpp/benchmarks/common/generate_benchmark_input.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ distribution_id default_distribution_id()
template <typename T, std::enable_if_t<cudf::is_timestamp<T>()>* = nullptr>
std::pair<int64_t, int64_t> default_range()
{
using simt::std::chrono::duration_cast;
using cuda::std::chrono::duration_cast;
auto const year = duration_cast<typename T::duration>(cudf::duration_D{365l});
return {50 * year.count(), 0};
}
Expand All @@ -106,7 +106,7 @@ std::pair<int64_t, int64_t> default_range()
template <typename T, std::enable_if_t<cudf::is_duration<T>()>* = nullptr>
std::pair<int64_t, int64_t> default_range()
{
using simt::std::chrono::duration_cast;
using cuda::std::chrono::duration_cast;
auto const year = duration_cast<typename T::duration>(cudf::duration_D{365l});
return {0, 2 * year.count()};
}
Expand Down
14 changes: 8 additions & 6 deletions cpp/include/cudf/ast/detail/operators.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
*/
#pragma once

#include <cmath>
#include <cudf/ast/operators.hpp>
#include <cudf/types.hpp>
#include <cudf/utilities/error.hpp>
#include <cudf/utilities/type_dispatcher.hpp>
#include <simt/type_traits>

#include <cuda/std/type_traits>

#include <cmath>
#include <type_traits>
#include <utility>
#include <vector>
Expand All @@ -33,10 +35,10 @@ namespace detail {

// Traits for valid operator / type combinations
template <typename Op, typename LHS, typename RHS>
constexpr bool is_valid_binary_op = simt::std::is_invocable<Op, LHS, RHS>::value;
constexpr bool is_valid_binary_op = cuda::std::is_invocable<Op, LHS, RHS>::value;

template <typename Op, typename T>
constexpr bool is_valid_unary_op = simt::std::is_invocable<Op, T>::value;
constexpr bool is_valid_unary_op = cuda::std::is_invocable<Op, T>::value;

/**
* @brief Operator dispatcher
Expand Down Expand Up @@ -983,7 +985,7 @@ struct return_type_functor {
std::enable_if_t<is_valid_binary_op<OperatorFunctor, LHS, RHS>>* = nullptr>
CUDA_HOST_DEVICE_CALLABLE void operator()(cudf::data_type& result)
{
using Out = simt::std::invoke_result_t<OperatorFunctor, LHS, RHS>;
using Out = cuda::std::invoke_result_t<OperatorFunctor, LHS, RHS>;
result = cudf::data_type(cudf::type_to_id<Out>());
}

Expand Down Expand Up @@ -1012,7 +1014,7 @@ struct return_type_functor {
std::enable_if_t<is_valid_unary_op<OperatorFunctor, T>>* = nullptr>
CUDA_HOST_DEVICE_CALLABLE void operator()(cudf::data_type& result)
{
using Out = simt::std::invoke_result_t<OperatorFunctor, T>;
using Out = cuda::std::invoke_result_t<OperatorFunctor, T>;
result = cudf::data_type(cudf::type_to_id<Out>());
}

Expand Down
4 changes: 2 additions & 2 deletions cpp/include/cudf/ast/detail/transform.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ struct unary_row_output : public row_output {
detail::device_data_reference output) const
{
using OperatorFunctor = detail::operator_functor<op>;
using Out = simt::std::invoke_result_t<OperatorFunctor, Input>;
using Out = cuda::std::invoke_result_t<OperatorFunctor, Input>;
resolve_output<Out>(output, row_index, OperatorFunctor{}(input));
}

Expand Down Expand Up @@ -104,7 +104,7 @@ struct binary_row_output : public row_output {
detail::device_data_reference output) const
{
using OperatorFunctor = detail::operator_functor<op>;
using Out = simt::std::invoke_result_t<OperatorFunctor, LHS, RHS>;
using Out = cuda::std::invoke_result_t<OperatorFunctor, LHS, RHS>;
resolve_output<Out>(output, row_index, OperatorFunctor{}(lhs, rhs));
}

Expand Down
23 changes: 22 additions & 1 deletion cpp/include/cudf/detail/copy_if.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,26 @@ __launch_bounds__(block_size) __global__
}
}

template <typename T, typename Enable = void>
struct DeviceType {
using type = T;
};

template <typename T>
struct DeviceType<T, std::enable_if_t<cudf::is_timestamp<T>()>> {
using type = typename T::rep;
};

template <typename T>
struct DeviceType<T, std::enable_if_t<std::is_same<numeric::decimal32, T>::value>> {
using type = typename cudf::device_storage_type_t<T>;
};

template <typename T>
struct DeviceType<T, std::enable_if_t<std::is_same<numeric::decimal64, T>::value>> {
using type = typename cudf::device_storage_type_t<T>;
};

// Dispatch functor which performs the scatter for fixed column types and gather for other
template <typename Filter, int block_size>
struct scatter_gather_functor {
Expand All @@ -219,7 +239,8 @@ struct scatter_gather_functor {

bool has_valid = input.nullable();

using Type = cudf::device_storage_type_t<T>;
using Type = typename DeviceType<T>::type;

auto scatter = (has_valid) ? scatter_kernel<Type, Filter, block_size, true>
: scatter_kernel<Type, Filter, block_size, false>;

Expand Down
41 changes: 20 additions & 21 deletions cpp/include/cudf/fixed_point/fixed_point.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,16 @@

#pragma once

#define _LIBCUDACXX_USE_CXX17_TYPE_TRAITS
#include <cudf/types.hpp>

// Note: The <simt/*> versions are used in order for Jitify to work with our fixed_point type.
// Note: The <cuda/std/*> versions are used in order for Jitify to work with our fixed_point type.
// Jitify is needed for several algorithms (binaryop, rolling, etc)
#include <simt/limits>
#include <simt/type_traits> // add simt namespace
#include <cuda/std/limits>
#include <cuda/std/type_traits> // add cuda namespace

#include <algorithm>
#include <cassert>
#include <cmath>

#include <string>

//! `fixed_point` and supporting types
Expand Down Expand Up @@ -60,13 +59,13 @@ enum class Radix : int32_t { BASE_2 = 2, BASE_10 = 10 };
template <typename T>
constexpr inline auto is_supported_representation_type()
{
return simt::std::is_same<T, int32_t>::value || simt::std::is_same<T, int64_t>::value;
return cuda::std::is_same<T, int32_t>::value || cuda::std::is_same<T, int64_t>::value;
}

template <typename T>
constexpr inline auto is_supported_construction_value_type()
{
return simt::std::is_integral<T>::value || simt::std::is_floating_point<T>::value;
return cuda::std::is_integral<T>::value || cuda::std::is_floating_point<T>::value;
}

// Helper functions for `fixed_point` type
Expand All @@ -87,7 +86,7 @@ namespace detail {
template <typename Rep,
Radix Base,
typename T,
typename simt::std::enable_if_t<(simt::std::is_same<int32_t, T>::value &&
typename cuda::std::enable_if_t<(cuda::std::is_same<int32_t, T>::value &&
is_supported_representation_type<Rep>())>* = nullptr>
CUDA_HOST_DEVICE_CALLABLE Rep ipow(T exponent)
{
Expand Down Expand Up @@ -192,7 +191,7 @@ CUDA_HOST_DEVICE_CALLABLE constexpr T shift(T const& val, scale_type const& scal
* @tparam Rep The representation type (either `int32_t` or `int64_t`)
*/
template <typename Rep,
typename simt::std::enable_if_t<is_supported_representation_type<Rep>()>* = nullptr>
typename cuda::std::enable_if_t<is_supported_representation_type<Rep>()>* = nullptr>
struct scaled_integer {
Rep value;
scale_type scale;
Expand Down Expand Up @@ -224,7 +223,7 @@ class fixed_point {
* @param scale The exponent that is applied to Rad to perform shifting
*/
template <typename T,
typename simt::std::enable_if_t<is_supported_construction_value_type<T>() &&
typename cuda::std::enable_if_t<is_supported_construction_value_type<T>() &&
is_supported_representation_type<Rep>()>* = nullptr>
CUDA_HOST_DEVICE_CALLABLE explicit fixed_point(T const& value, scale_type const& scale)
: _value{static_cast<Rep>(detail::shift<Rep, Rad>(value, scale))}, _scale{scale}
Expand All @@ -245,7 +244,7 @@ class fixed_point {
* value and scale of zero
*/
template <typename T,
typename simt::std::enable_if_t<is_supported_construction_value_type<T>()>* = nullptr>
typename cuda::std::enable_if_t<is_supported_construction_value_type<T>()>* = nullptr>
CUDA_HOST_DEVICE_CALLABLE fixed_point(T const& value)
: _value{static_cast<Rep>(value)}, _scale{scale_type{0}}
{
Expand All @@ -265,7 +264,7 @@ class fixed_point {
* @return The `fixed_point` number in base 10 (aka human readable format)
*/
template <typename U,
typename simt::std::enable_if_t<is_supported_construction_value_type<U>()>* = nullptr>
typename cuda::std::enable_if_t<is_supported_construction_value_type<U>()>* = nullptr>
CUDA_HOST_DEVICE_CALLABLE explicit constexpr operator U() const
{
return detail::shift<Rep, Rad>(static_cast<U>(_value), detail::negate(_scale));
Expand Down Expand Up @@ -538,9 +537,9 @@ class fixed_point {
template <typename Rep>
std::string print_rep()
{
if (simt::std::is_same<Rep, int32_t>::value)
if (cuda::std::is_same<Rep, int32_t>::value)
return "int32_t";
else if (simt::std::is_same<Rep, int64_t>::value)
else if (cuda::std::is_same<Rep, int64_t>::value)
return "int64_t";
else
return "unknown type";
Expand All @@ -557,8 +556,8 @@ std::string print_rep()
template <typename Rep, typename T>
CUDA_HOST_DEVICE_CALLABLE auto addition_overflow(T lhs, T rhs)
{
return rhs > 0 ? lhs > simt::std::numeric_limits<Rep>::max() - rhs
: lhs < simt::std::numeric_limits<Rep>::min() - rhs;
return rhs > 0 ? lhs > cuda::std::numeric_limits<Rep>::max() - rhs
: lhs < cuda::std::numeric_limits<Rep>::min() - rhs;
}

/** @brief Function for identifying integer overflow when subtracting
Expand All @@ -572,8 +571,8 @@ CUDA_HOST_DEVICE_CALLABLE auto addition_overflow(T lhs, T rhs)
template <typename Rep, typename T>
CUDA_HOST_DEVICE_CALLABLE auto subtraction_overflow(T lhs, T rhs)
{
return rhs > 0 ? lhs < simt::std::numeric_limits<Rep>::min() + rhs
: lhs > simt::std::numeric_limits<Rep>::max() + rhs;
return rhs > 0 ? lhs < cuda::std::numeric_limits<Rep>::min() + rhs
: lhs > cuda::std::numeric_limits<Rep>::max() + rhs;
}

/** @brief Function for identifying integer overflow when dividing
Expand All @@ -587,7 +586,7 @@ CUDA_HOST_DEVICE_CALLABLE auto subtraction_overflow(T lhs, T rhs)
template <typename Rep, typename T>
CUDA_HOST_DEVICE_CALLABLE auto division_overflow(T lhs, T rhs)
{
return lhs == simt::std::numeric_limits<Rep>::min() && rhs == -1;
return lhs == cuda::std::numeric_limits<Rep>::min() && rhs == -1;
}

/** @brief Function for identifying integer overflow when multiplying
Expand All @@ -601,8 +600,8 @@ CUDA_HOST_DEVICE_CALLABLE auto division_overflow(T lhs, T rhs)
template <typename Rep, typename T>
CUDA_HOST_DEVICE_CALLABLE auto multiplication_overflow(T lhs, T rhs)
{
auto const min = simt::std::numeric_limits<Rep>::min();
auto const max = simt::std::numeric_limits<Rep>::max();
auto const min = cuda::std::numeric_limits<Rep>::min();
auto const max = cuda::std::numeric_limits<Rep>::max();
if (rhs > 0)
return lhs > max / rhs || lhs < min / rhs;
else if (rhs < -1)
Expand Down
6 changes: 3 additions & 3 deletions cpp/include/cudf/utilities/traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <cudf/wrappers/durations.hpp>
#include <cudf/wrappers/timestamps.hpp>

#include <simt/type_traits>
#include <cuda/std/type_traits>

namespace cudf {

Expand Down Expand Up @@ -66,14 +66,14 @@ struct is_equality_comparable_impl<L, R, void_t<equality_comparable<L, R>>> : st
};

template <typename T>
using is_timestamp_t = simt::std::disjunction<std::is_same<cudf::timestamp_D, T>,
using is_timestamp_t = cuda::std::disjunction<std::is_same<cudf::timestamp_D, T>,
std::is_same<cudf::timestamp_s, T>,
std::is_same<cudf::timestamp_ms, T>,
std::is_same<cudf::timestamp_us, T>,
std::is_same<cudf::timestamp_ns, T>>;

template <typename T>
using is_duration_t = simt::std::disjunction<std::is_same<cudf::duration_D, T>,
using is_duration_t = cuda::std::disjunction<std::is_same<cudf::duration_D, T>,
std::is_same<cudf::duration_s, T>,
std::is_same<cudf::duration_ms, T>,
std::is_same<cudf::duration_us, T>,
Expand Down
4 changes: 2 additions & 2 deletions cpp/include/cudf/utilities/type_dispatcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
#pragma once

#include <cudf/detail/utilities/release_assert.cuh>
#include <cudf/fixed_point/fixed_point.hpp>
#include <cudf/types.hpp>
#include <cudf/utilities/error.hpp>
#include <cudf/wrappers/dictionary.hpp>
#include <cudf/wrappers/durations.hpp>
#include <cudf/wrappers/timestamps.hpp>
#include <string>

#include <cudf/fixed_point/fixed_point.hpp>
#include <string>

/**
* @file
Expand Down
15 changes: 6 additions & 9 deletions cpp/include/cudf/wrappers/durations.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@

#include <limits>

#define _LIBCUDACXX_USE_CXX20_CHRONO
#define _LIBCUDACXX_USE_CXX17_TYPE_TRAITS

#include <simt/chrono>
#include <cuda/std/chrono>

namespace cudf {

Expand All @@ -35,23 +32,23 @@ namespace cudf {
/**
* @brief Type alias representing an int32_t duration of days.
**/
using duration_D = simt::std::chrono::duration<int32_t, simt::std::chrono::days::period>;
using duration_D = cuda::std::chrono::duration<int32_t, cuda::std::chrono::days::period>;
/**
* @brief Type alias representing an int64_t duration of seconds.
**/
using duration_s = simt::std::chrono::duration<int64_t, simt::std::chrono::seconds::period>;
using duration_s = cuda::std::chrono::duration<int64_t, cuda::std::chrono::seconds::period>;
/**
* @brief Type alias representing an int64_t duration of milliseconds.
**/
using duration_ms = simt::std::chrono::duration<int64_t, simt::std::chrono::milliseconds::period>;
using duration_ms = cuda::std::chrono::duration<int64_t, cuda::std::chrono::milliseconds::period>;
/**
* @brief Type alias representing an int64_t duration of microseconds.
**/
using duration_us = simt::std::chrono::duration<int64_t, simt::std::chrono::microseconds::period>;
using duration_us = cuda::std::chrono::duration<int64_t, cuda::std::chrono::microseconds::period>;
/**
* @brief Type alias representing an int64_t duration of nanoseconds.
**/
using duration_ns = simt::std::chrono::duration<int64_t, simt::std::chrono::nanoseconds::period>;
using duration_ns = cuda::std::chrono::duration<int64_t, cuda::std::chrono::nanoseconds::period>;

static_assert(sizeof(duration_D) == sizeof(typename duration_D::rep), "");
static_assert(sizeof(duration_s) == sizeof(typename duration_s::rep), "");
Expand Down
Loading