From d3f4260eda7c8434c46e0fa7bf00ec7c923b55a5 Mon Sep 17 00:00:00 2001 From: Eduard Valeyev Date: Sun, 17 Sep 2023 20:29:06 -0400 Subject: [PATCH] FindOrFetchBTAS: tell linalg++ to look for CUDA or HIP --- cmake/modules/FindOrFetchBTAS.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmake/modules/FindOrFetchBTAS.cmake b/cmake/modules/FindOrFetchBTAS.cmake index 57a4b94ac0..35ad3dd200 100644 --- a/cmake/modules/FindOrFetchBTAS.cmake +++ b/cmake/modules/FindOrFetchBTAS.cmake @@ -17,8 +17,14 @@ if (NOT TARGET BTAS::BTAS) set(_linalgpp_use_standard_linalg_kits TRUE) endif(DEFINED BLA_VENDOR) - if (NOT TILEDARRAY_HAS_CUDA) - # tell BLAS++/LAPACK++ to ignore CUDA + if (TILEDARRAY_HAS_CUDA) + # tell BLAS++/LAPACK++ to also look for CUDA + set(gpu_backend cuda CACHE STRING "The device backend to use for Linalg++") + elseif (TILEDARRAY_HAS_HIP) + # tell BLAS++/LAPACK++ to also look for HIP + set(gpu_backend hip CACHE STRING "The device backend to use for Linalg++") + else () + # tell BLAS++/LAPACK++ to not look for device backends set(gpu_backend none CACHE STRING "The device backend to use for Linalg++") endif()