scs icon indicating copy to clipboard operation
scs copied to clipboard

Add support for GPU in CMake buildsystem

Open traversaro opened this issue 4 years ago • 3 comments

https://github.com/cvxgrp/scs/pull/161 added a CMake-based buildsystem, but at the moment the GPU builds are not supported there. It would be convenient to modify it to support also GPU builds. I plan to work on this as part of https://github.com/conda-forge/scs-feedstock/issues/18, this is just a placeholder issue to make sure that anyone interested is aware of this.

traversaro avatar Jun 06 '21 17:06 traversaro

I am definitely not an expert in this, but given that apparently this is just a C library that links CUDA libraries, it should be sufficient to use https://cmake.org/cmake/help/latest/module/FindCUDAToolkit.html . If instead the library contained .cu files, we should have enabled the CUDA language, see https://cliutils.gitlab.io/modern-cmake/chapters/packages/CUDA.html .

traversaro avatar Jun 06 '21 17:06 traversaro

Hello @bodono, happy new year! :)

Could we come back to this issue?

I'd add that it might be a good idea to consider moving the reference build system to CMake completely - it's just much more portable than a Makefile; otherwise it's a constant battle to keep them in sync resp. working equivalently.

h-vetinari avatar Jan 04 '23 09:01 h-vetinari

On the GPU stuff - the GPU code is still broken in some way that I haven't had time to track down. Overall the GPU doesn't provide much benefit anyway and users are probably better off using MKL (if they can).

I agree that CMake is better than Make overall. Unfortunately I don't know much about CMake, and I didn't contribute the original CMake code to SCS. I'd be happy to accept a PR that removes the Makefile and cleans up the CMake file if anyone is able to help!

bodono avatar Jan 06 '23 10:01 bodono