Skip to content

Commit

Permalink
use result from reduce_to_column_tree for csr
Browse files Browse the repository at this point in the history
  • Loading branch information
karthikeyann committed Sep 21, 2024
1 parent 4d4ce13 commit 7de2ce3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cpp/src/io/json/host_tree_algorithms.cu
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ void make_device_json_column(device_span<SymbolT const> input,
#ifdef CSR_DEBUG_EQ
auto [d_column_tree_csr, d_column_tree_properties] =
cudf::io::json::experimental::detail::reduce_to_column_tree(
tree, col_ids, row_offsets, is_array_of_arrays, row_array_parent_col_id, stream);
d_column_tree, d_unique_col_ids, d_max_row_offsets, is_array_of_arrays, row_array_parent_col_id, stream);

auto iseq = check_equality(
d_column_tree, d_max_row_offsets, d_column_tree_csr, d_column_tree_properties, stream);
Expand Down
7 changes: 4 additions & 3 deletions cpp/src/io/json/json_column.cu
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ reduce_to_column_tree(tree_meta_t& tree,
return NC_ERR;
});
// 4. unique_copy parent_node_ids, ranges
rmm::device_uvector<TreeDepthT> column_levels(0, stream); // not required
rmm::device_uvector<TreeDepthT> column_levels(num_columns, stream); // required for CSR
rmm::device_uvector<NodeIndexT> parent_col_ids(num_columns, stream);
rmm::device_uvector<SymbolOffsetT> col_range_begin(num_columns, stream); // Field names
rmm::device_uvector<SymbolOffsetT> col_range_end(num_columns, stream);
Expand All @@ -179,10 +179,11 @@ reduce_to_column_tree(tree_meta_t& tree,
thrust::make_zip_iterator(
thrust::make_permutation_iterator(tree.parent_node_ids.begin(), unique_node_ids.begin()),
thrust::make_permutation_iterator(tree.node_range_begin.begin(), unique_node_ids.begin()),
thrust::make_permutation_iterator(tree.node_range_end.begin(), unique_node_ids.begin())),
thrust::make_permutation_iterator(tree.node_range_end.begin(), unique_node_ids.begin()),
thrust::make_permutation_iterator(tree.node_levels.begin(), unique_node_ids.begin())),
unique_node_ids.size(),
thrust::make_zip_iterator(
parent_col_ids.begin(), col_range_begin.begin(), col_range_end.begin()));
parent_col_ids.begin(), col_range_begin.begin(), col_range_end.begin(), column_levels.begin()));

// convert parent_node_ids to parent_col_ids
thrust::transform(
Expand Down

0 comments on commit 7de2ce3

Please sign in to comment.