Skip to content

Commit

Permalink
A small optimization for JNI copy column view to column vector (rapid…
Browse files Browse the repository at this point in the history
…sai#8985)

So if the underlying class is a ColumnVector then we don't make a copy of the data, we just increment the reference count.

Authors:
  - Robert (Bobby) Evans (https://github.com/revans2)

Approvers:
  - Jason Lowe (https://github.com/jlowe)
  - Kuhu Shukla (https://github.com/kuhushukla)
  - Niranjan Artal (https://github.com/nartal1)

URL: rapidsai#8985
  • Loading branch information
revans2 authored and shwina committed Aug 9, 2021
1 parent 20bb17f commit 0ce219b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion java/src/main/java/ai/rapids/cudf/ColumnVector.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,16 @@ private ColumnVector(long viewAddress, DeviceMemoryBuffer contiguousBuffer) {
incRefCountInternal(true);
}


/**
* For a ColumnVector this is really just incrementing the reference count.
* @return this
*/
@Override
public ColumnVector copyToColumnVector() {
return incRefCount();
}

/**
* Retrieves the column_view for a cudf::column and if it fails to do so, the column is deleted
* and the exception is thrown to the caller.
Expand Down Expand Up @@ -803,7 +813,7 @@ private static native long stringConcatenation(long[] columnViews, long separato
/**
* Native method to concatenate columns of strings together using a separator specified for each row
* and returns the result as a string column.
* @param columns array of longs holding the native handles of the column_views to combine.
* @param columnViews array of longs holding the native handles of the column_views to combine.
* @param sep_column long holding the native handle of the strings_column_view used as separators.
* @param separator_narep string scalar indicating null behavior when a separator is null.
* If set to null and the separator is null the resulting string will
Expand Down

0 comments on commit 0ce219b

Please sign in to comment.