Skip to content

Commit

Permalink
add an allocate method with stream in java DeviceMemoryBuffer (rapids…
Browse files Browse the repository at this point in the history
…ai#7826)

Looks like this is also needed in order to remove the `CudaUtil` class in the rapids spark plugin.

@abellina @jlowe

Authors:
  - Rong Ou (https://github.com/rongou)

Approvers:
  - Jason Lowe (https://github.com/jlowe)
  - Alessandro Bellina (https://github.com/abellina)

URL: rapidsai#7826
  • Loading branch information
rongou authored and shwina committed Apr 7, 2021
1 parent 7c1de28 commit 43e3f88
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion java/src/main/java/ai/rapids/cudf/DeviceMemoryBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,17 @@ private DeviceMemoryBuffer(long address, long lengthInBytes, DeviceMemoryBuffer
* @return the buffer
*/
public static DeviceMemoryBuffer allocate(long bytes) {
return Rmm.alloc(bytes);
return allocate(bytes, Cuda.DEFAULT_STREAM);
}

/**
* Allocate memory for use on the GPU. You must close it when done.
* @param bytes size in bytes to allocate
* @param stream The stream in which to synchronize this command
* @return the buffer
*/
public static DeviceMemoryBuffer allocate(long bytes, Cuda.Stream stream) {
return Rmm.alloc(bytes, stream);
}

/**
Expand Down

0 comments on commit 43e3f88

Please sign in to comment.