Skip to content

Commit

Permalink
change step of increasing the bufferLength
Browse files Browse the repository at this point in the history
Signed-off-by: Ahmed Hussein (amahussein) <a@ahussein.me>
  • Loading branch information
amahussein committed Jul 22, 2022
1 parent 1abc07f commit f4db01e
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,9 @@ public ColumnarBatch next() {
}
} catch (BufferOverflowException ex) {
// Handle corner case when the dataLength is too small to copy a single row.
// Increase dataBuffer size by 25%
// We retry after doubling the bufferSize.
// dataLength can be considered a rough estimate of a single row.
long newRowSizeEst =
JCudfUtil.alignOffset((int) (dataLength * 125) / 100, JCudfUtil.JCUDF_ROW_ALIGNMENT);
long newRowSizeEst = dataLength << 1 ;
newRowSizeEst = Math.min(newRowSizeEst, JCudfUtil.JCUDF_MAX_DATA_BUFFER_LENGTH);
if (newRowSizeEst <= dataLength) { // We already reached the limit.
// proceed with throwing exception.
Expand All @@ -204,8 +203,8 @@ public ColumnarBatch next() {
try (NvtxRange ignored = buildRange;
ColumnVector cv = devColumn;
Table tab = fitsOptimizedConversion ?
// The fixed-width optimized cudf kernel only supports up to 1.5 KB per row which means
// at most 184 double/long values.
// The fixed-width optimized cudf kernel only supports up to 1.5 KB per row which
// means at most 184 double/long values.
Table.convertFromRowsFixedWidthOptimized(cv, rapidsTypes) :
Table.convertFromRows(cv, rapidsTypes)) {
return GpuColumnVector.from(tab, outputTypes);
Expand Down

0 comments on commit f4db01e

Please sign in to comment.