Skip to content

Commit

Permalink
Pass the spans through the code.
Browse files Browse the repository at this point in the history
  • Loading branch information
vyasr committed May 3, 2021
1 parent f0a5c66 commit d2a5e8b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 24 deletions.
24 changes: 13 additions & 11 deletions cpp/include/cudf/ast/detail/transform.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,11 @@ struct row_evaluator {
* storing intermediates.
* @param output_column The output column where results are stored.
*/
__device__ row_evaluator(table_device_view const& table,
const cudf::detail::fixed_width_scalar_device_view_base* literals,
std::int64_t* thread_intermediate_storage,
mutable_column_device_view* output_column)
__device__ row_evaluator(
table_device_view const& table,
device_span<const cudf::detail::fixed_width_scalar_device_view_base> literals,
std::int64_t* thread_intermediate_storage,
mutable_column_device_view* output_column)
: table(table),
literals(literals),
thread_intermediate_storage(thread_intermediate_storage),
Expand Down Expand Up @@ -266,7 +267,7 @@ struct row_evaluator {

private:
table_device_view const& table;
const cudf::detail::fixed_width_scalar_device_view_base* literals;
device_span<const cudf::detail::fixed_width_scalar_device_view_base> literals;
std::int64_t* thread_intermediate_storage;
mutable_column_device_view* output_column;
};
Expand Down Expand Up @@ -300,12 +301,13 @@ __device__ void row_output::resolve_output(detail::device_data_reference device_
* @param num_operators Number of operators.
* @param row_index Row index of data column(s).
*/
__device__ void evaluate_row_expression(detail::row_evaluator const& evaluator,
const detail::device_data_reference* data_references,
const ast_operator* operators,
const cudf::size_type* operator_source_indices,
cudf::size_type num_operators,
cudf::size_type row_index)
__device__ void evaluate_row_expression(
detail::row_evaluator const& evaluator,
device_span<const detail::device_data_reference> data_references,
device_span<const ast_operator> operators,
device_span<const cudf::size_type> operator_source_indices,
cudf::size_type num_operators,
cudf::size_type row_index)
{
auto operator_source_index = static_cast<cudf::size_type>(0);
for (cudf::size_type operator_index = 0; operator_index < num_operators; operator_index++) {
Expand Down
26 changes: 13 additions & 13 deletions cpp/src/ast/transform.cu
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ namespace detail {
* each thread.
*/
template <cudf::size_type max_block_size>
__launch_bounds__(max_block_size) __global__
void compute_column_kernel(table_device_view const table,
const cudf::detail::fixed_width_scalar_device_view_base* literals,
mutable_column_device_view output_column,
const detail::device_data_reference* data_references,
const ast_operator* operators,
const cudf::size_type* operator_source_indices,
cudf::size_type num_operators,
cudf::size_type num_intermediates)
__launch_bounds__(max_block_size) __global__ void compute_column_kernel(
table_device_view const table,
device_span<const cudf::detail::fixed_width_scalar_device_view_base> literals,
mutable_column_device_view output_column,
device_span<const detail::device_data_reference> data_references,
device_span<const ast_operator> operators,
device_span<const cudf::size_type> operator_source_indices,
cudf::size_type num_operators,
cudf::size_type num_intermediates)
{
extern __shared__ std::int64_t intermediate_storage[];
auto thread_intermediate_storage = &intermediate_storage[threadIdx.x * num_intermediates];
Expand Down Expand Up @@ -123,11 +123,11 @@ std::unique_ptr<column> compute_column(table_view const table,
cudf::ast::detail::compute_column_kernel<MAX_BLOCK_SIZE>
<<<config.num_blocks, config.num_threads_per_block, shmem_size_per_block, stream.value()>>>(
*table_device,
plan._device_literals.data(),
plan._device_literals,
*mutable_output_device,
plan._device_data_references.data(),
plan._device_operators.data(),
plan._device_operator_source_indices.data(),
plan._device_data_references,
plan._device_operators,
plan._device_operator_source_indices,
num_operators,
num_intermediates);
CHECK_CUDA(stream.value());
Expand Down

0 comments on commit d2a5e8b

Please sign in to comment.