cpp/tests/io/csv_test.cpp
// timestamp column checker within tolerance
// given by `tol_ms` (miliseconds)
timestamp column checker within tolerance
given by `tol_ms` (miliseconds)
timestamp column checker within tolerance given by ` tol_ms ` ( miliseconds )
void check_timestamp_column(cudf::column_view const& col_lhs,
                            cudf::column_view const& col_rhs,
                            long tol_ms = 1000l)
{
  using T = cudf::timestamp_ms;
  using namespace simt::std::chrono;
  auto h_lhs = cudf::test::to_host<T>(col_lhs).first;
  auto h_rhs = cudf::test::to_host<T>(col_rhs).first;
  cudf::size_type nrows = h_lhs.size();
  EXPECT_TRUE(nrows == static_cast<cudf::size_type>(h_rhs.size()));
  auto begin_count = thrust::make_counting_iterator<cudf::size_type>(0);
  auto end_count   = thrust::make_counting_iterator<cudf::size_type>(nrows);
  auto* ptr_lhs = h_lhs.data();  
  auto* ptr_rhs = h_rhs.data();
  auto found = thrust::find_if(
    thrust::host, begin_count, end_count, [ptr_lhs, ptr_rhs, tol_ms](auto row_index) {
      auto delta_ms = simt::std::chrono::duration_cast<simt::std::chrono::milliseconds>(
        ptr_lhs[row_index] - ptr_rhs[row_index]);
      return delta_ms.count() >= tol_ms;
    });
  EXPECT_TRUE(found == end_count);  
}
void check_timestamp_column ( cudf :: column_view const & col_lhs , cudf :: column_view const & col_rhs , long tol_ms = 1000l ) { using T = cudf :: timestamp_ms ; using namespace simt :: std :: chrono ; auto h_lhs = cudf :: test :: to_host < T > ( col_lhs ) . first ; auto h_rhs = cudf :: test :: to_host < T > ( col_rhs ) . first ; cudf :: size_type nrows = h_lhs . size ( ) ; EXPECT_TRUE ( nrows == static_cast < cudf :: size_type > ( h_rhs . size ( ) ) ) ; auto begin_count = thrust :: make_counting_iterator < cudf :: size_type > ( 0 ) ; auto end_count = thrust :: make_counting_iterator < cudf :: size_type > ( nrows ) ; auto * ptr_lhs = h_lhs . data ( ) ; auto * ptr_rhs = h_rhs . data ( ) ; auto found = thrust :: find_if ( thrust :: host , begin_count , end_count , [ ptr_lhs , ptr_rhs , tol_ms ] ( auto row_index ) { auto delta_ms = simt :: std :: chrono :: duration_cast < simt :: std :: chrono :: milliseconds > ( ptr_lhs [ row_index ] - ptr_rhs [ row_index ] ) ; return delta_ms . count ( ) >= tol_ms ; } ) ; EXPECT_TRUE ( found == end_count ) ; }
timestamp column checker within tolerance
given by `tol_ms` (miliseconds)
timestamp column checker within tolerance given by ` tol_ms ` ( miliseconds )
// cannot capture host_vector in thrust, // not even in host lambda // not found...