Open vadixidav opened 4 years ago
Would it be possible to implement more algorithms in GPU using something like emu or wgpu-rs so it works cross-platform?
Of course. In case it wasn't clear, WebGPU is wgpu. AKAZE will be the first algorithm converted to GPU because that is required to get >5 FPS visual SLAM. However, I would love it if everything in cv-sfm could eventually be ran on the GPU without any CPU routines bottlenecking the process. Also, image processing routines all running GPU side would be excellent as well. However, it will take some time, and this issue is just to solve a small piece of that GPU optimization.
AKAZE can be sped up in several places with GPU routines. Support should be added using WebGPU to get the highest level of cross-platform support for compute acceleration. The three parts that are important is the diffusion step, gradient computation, and feature extraction. Currently, the first two of these are done with
ndarray
, but GPU should be optionally supported. This will be gated behind an optional feature, but it should be capable of falling back to the CPU implementation if GPUs are not available for compute. At this time, it is not necessary to tell AKAZE which GPU device to use to perform the compute.