diff options
author | Smit Hinsu <hinsu@google.com> | 2018-05-21 17:42:15 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-05-21 17:44:41 -0700 |
commit | b1139814f91c5216eb5ff229ee7e1982e5f4e888 (patch) | |
tree | 7f85c8229bfd47eeba49890aa75b59c8680e619c /tensorflow/stream_executor/cuda/cuda_driver.h | |
parent | d913a243196fa07d4728c8f7c1ce6444ecd086eb (diff) |
Introduce an option to allocate CUDA unified memory
PiperOrigin-RevId: 197490523
Diffstat (limited to 'tensorflow/stream_executor/cuda/cuda_driver.h')
-rw-r--r-- | tensorflow/stream_executor/cuda/cuda_driver.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tensorflow/stream_executor/cuda/cuda_driver.h b/tensorflow/stream_executor/cuda/cuda_driver.h index b952cfaf68..3713a5b7b9 100644 --- a/tensorflow/stream_executor/cuda/cuda_driver.h +++ b/tensorflow/stream_executor/cuda/cuda_driver.h @@ -106,6 +106,16 @@ class CUDADriver { // http://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g89b3f154e17cc89b6eea277dbdf5c93a static void DeviceDeallocate(CudaContext* context, void *location); + // Allocates a unified memory space of size bytes associated with the given + // context via cuMemAllocManaged. + // https://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1gb347ded34dc326af404aa02af5388a32 + static void* UnifiedMemoryAllocate(CudaContext* context, uint64 bytes); + + // Deallocates a unified memory space of size bytes associated with the given + // context via cuMemFree. + // http://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g89b3f154e17cc89b6eea277dbdf5c93a + static void UnifiedMemoryDeallocate(CudaContext* context, void* location); + // Allocates page-locked and CUDA-registered memory on the host via // cuMemAllocHost. // http://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1gdd8311286d2c2691605362c689bc64e0 |