Skip to content

Commit

Permalink
Merge pull request #6 from koide3/mem
Browse files Browse the repository at this point in the history
cuda_mem_get_info
  • Loading branch information
koide3 committed Jul 20, 2024
2 parents 17f78e8 + ac0d902 commit 71a104b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/gtsam_points/cuda/cuda_memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ void cuda_host_to_device(void* dst, const void* src, size_t size, CUstream_st* s

void cuda_device_to_host(void* dst, const void* src, size_t size, CUstream_st* stream = nullptr);

void cuda_mem_get_info(size_t* free, size_t* total);

template <typename T>
T* cuda_new(CUstream_st* stream = nullptr) {
return cuda_malloc(sizeof(T), stream);
Expand Down
4 changes: 4 additions & 0 deletions src/gtsam_points/cuda/cuda_memory.cu
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,8 @@ void cuda_device_to_host(void* dst, const void* src, size_t size, CUstream_st* s
check_error << cudaMemcpyAsync(dst, src, size, cudaMemcpyDeviceToHost, stream);
}

void cuda_mem_get_info(size_t* free, size_t* total) {
check_error << cudaMemGetInfo(free, total);
}

} // namespace gtsam_points

0 comments on commit 71a104b

Please sign in to comment.