icl-utk-edu / lapackpp

LAPACK++ is a C++ wrapper around CPU and GPU LAPACK and LAPACK-like linear algebra libraries, developed as part of the SLATE project.
https://icl.utk.edu/slate/
BSD 3-Clause "New" or "Revised" License
51 stars 14 forks source link

`gpu_backend` breaks containment in subproject CMake builds #23

Closed wavefunction91 closed 1 year ago

wavefunction91 commented 1 year ago

In cases where lapackpp is included as a subproject, gpu_backend breaks containment and can be overridden by previous enablement / discovery of a CUDA compiler (e.g. CMAKE_CUDA_COMPILER is defined). The offending line is here. This used to be a problem in blaspp as well, but has since been fixed. See logic here.

In general, relying on possibly externally set variables may lead to unexpected behaviour.

mgates3 commented 1 year ago

Makes sense. I don't remember why it was written this way, with two consecutive ifs rather than nested ifs.

mgates3 commented 1 year ago

@wavefunction91 Does PR #24 resolve the issue?

wavefunction91 commented 1 year ago

@mgates3 sorry - yes, this fixes the issue