Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 6 additions & 2 deletions cpp/src/io/json/column_tree_construction.cu
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,12 @@ std::tuple<compressed_sparse_row, column_tree_properties> reduce_to_column_tree(
}),
cuda::std::plus<NodeIndexT>{});
} else {
auto single_node = 1;
row_idx.set_element_async(1, single_node, stream);
// Uses thrust::fill instead of device_uvector::set_element_async to prevent the case where
// single_node goes out of scope before the memcpy-async(stream) completes. This is also
// allows us to make the copy without incurring a stream synchronize.
auto single_node = NodeIndexT{1};
auto exec_policy = rmm::exec_policy_nosync(stream, cudf::get_current_device_resource_ref());
thrust::fill(exec_policy, row_idx.begin() + 1, row_idx.end(), single_node);
Comment thread
davidwendt marked this conversation as resolved.
Comment thread
davidwendt marked this conversation as resolved.
}

#ifdef CSR_DEBUG_PRINT
Expand Down
8 changes: 8 additions & 0 deletions cpp/tests/io/json/json_tree_csr.cu
Original file line number Diff line number Diff line change
Expand Up @@ -364,3 +364,11 @@ TEST_F(JsonColumnTreeTests, JSONL_CornerCase_EmptyListOfLists)
std::string json_string = R"([[]])";
run_test(json_string, true);
}

TEST_F(JsonColumnTreeTests, JSONL_CornerCase_SingleColumn)
{
std::string json_string = R"({}
{}
{})";
run_test(json_string, true);
}
Comment thread
davidwendt marked this conversation as resolved.
Loading