Commit Graph

7 Commits

Author SHA1 Message Date
Joydeep Biswas fc826c5780 CUDA Cleanup
* All Cuda* objects now take in a ContextImpl* during
  construction, and save the context instead of individual
  handles.
* Since we no longer use the legacy default stream, we need to
  explicitly synchronize the stream before performing GPU->CPU
  transfers, and CudaBuffer is responsible for such synchronization
  when asked to perform GPU to CPU transfers.
* Remove all manual syncs and relegate syncing to CudaBuffer
  before performing GPU to CPU transfers.

Change-Id: Ic73cb24174a1e09842827323280e90241716cc20
2022-09-19 10:02:53 -05:00
Sameer Agarwal 5f19468794 clang-formated source
Change-Id: Ia15a55ae053e38d19e1fe7bbc6e452f5d0d1d3ed
2022-09-01 17:01:58 -07:00
Joydeep Biswas 00a05cf70f CUDA SDK Version-based SpMV Selection
* The algorithm enum value for SpMV is now selected based on the
  version of the CUDA runtime that Ceres is compiled against.

Change-Id: I2e0e39f1cbdb8ac26d2a9d45f4ebfc09b96d872b
2022-08-30 10:13:32 -05:00
Joydeep Biswas 344929647a Add CUDA GPU and Runtime Detection
* Added GPU device and CUDA compute capability identification.
* Added GpuMemoryAvailable() to aid downstream optimizations based
  on GPU memory availability.

Change-Id: I326dc1e4b7a6a7f5571b7e5479eb9aa300ad1075
2022-08-18 17:07:32 -05:00
Sameer Agarwal 6085e45be7 Minor CUDA cleanup.
1. ceres_cuda_kernels.cu -> cuda_kernels.cu.cc
2. Add missing ifdef guards.
3. Fix an errant namespace

Change-Id: I81a5bfbe3c795ff0b3ef41c3bcaa037b99d5b254
2022-08-17 16:27:13 -07:00
Sameer Agarwal 6ab435d774 Fix a missing CERES_NO_CUDA guard
Also run format_all.sh.

Change-Id: I13902c1d3eb0d3a97548540fee13ec67c490a5ff
2022-08-14 16:58:09 -07:00
Joydeep Biswas c560bc2be5 CUDA CGNR, Part 3: CudaSparseMatrix
* Added CudaSparseMatrix to manage and operate on sparse matrices with
  cuSparse.
* Added tests for CudaSparseMatrix.
* Added a new sparse linear operator benchmark.

Change-Id: Id09df46de3b40be1f14441528088b54dab5844af
2022-08-14 18:48:55 -05:00