@@ -184,71 +184,52 @@ if(COMMIT_INFO)
184184 endif ()
185185endif ()
186186
187- # Different exe files of ABACUS
188- unset (ABACUS_BIN_NAME CACHE )
187+ # Determine the ABACUS executable name.
188+ if (NOT ENABLE_LCAO)
189+ set (_abacus_bin_level "pw" )
190+ # TODO: Not well-defined now.
191+ elseif (ENABLE_LIBRI AND ENABLE_MLALGO)
192+ set (_abacus_bin_level "max" )
193+ elseif (ENABLE_LIBRI)
194+ set (_abacus_bin_level "std" )
195+ # TODO: Not well-defined now.
196+ elseif (ENABLE_MLALGO)
197+ set (_abacus_bin_level "ml" )
198+ else ()
199+ set (_abacus_bin_level "basic" )
200+ endif ()
189201
190- # Case : LCAO or PW
191- if (ENABLE_LCAO)
192- # Case: CUDA is enabled (suffix with 'g' for GPU)
193- if (USE_CUDA)
194- if (ENABLE_MPI)
195- if (NOT ENABLE_LIBRI AND NOT ENABLE_MLALGO)
196- set (ABACUS_BIN_NAME abacus_basic_gpu)
197- elseif (ENABLE_LIBRI AND NOT ENABLE_MLALGO)
198- set (ABACUS_BIN_NAME abacus_std_gpu)
199- elseif (NOT ENABLE_LIBRI AND ENABLE_MLALGO)
200- set (ABACUS_BIN_NAME abacus_ml_gpu)
201- elseif (ENABLE_LIBRI AND ENABLE_MLALGO)
202- set (ABACUS_BIN_NAME abacus_max_gpu)
203- endif ()
204- endif ()
205- # Case: CPU is enabled (suffix with 'p' for parallel)
206- else ()
207- if (ENABLE_MPI)
208- if (NOT ENABLE_LIBRI AND NOT ENABLE_MLALGO)
209- set (ABACUS_BIN_NAME abacus_basic_para)
210- elseif (ENABLE_LIBRI AND NOT ENABLE_MLALGO)
211- set (ABACUS_BIN_NAME abacus_std_para)
212- elseif (NOT ENABLE_LIBRI AND ENABLE_MLALGO)
213- set (ABACUS_BIN_NAME abacus_ml_para)
214- elseif (ENABLE_LIBRI AND ENABLE_MLALGO)
215- set (ABACUS_BIN_NAME abacus_max_para)
216- endif ()
217- else ()
218- if (NOT ENABLE_LIBRI AND NOT ENABLE_MLALGO)
219- set (ABACUS_BIN_NAME abacus_basic_ser)
220- elseif (ENABLE_LIBRI AND NOT ENABLE_MLALGO)
221- set (ABACUS_BIN_NAME abacus_std_ser)
222- elseif (NOT ENABLE_LIBRI AND ENABLE_MLALGO)
223- set (ABACUS_BIN_NAME abacus_ml_ser)
224- elseif (ENABLE_LIBRI AND ENABLE_MLALGO)
225- set (ABACUS_BIN_NAME abacus_max_ser)
226- endif ()
227- endif ()
228- endif ()
229- # Case : PW only
202+ if (ENABLE_MPI)
203+ set (_abacus_bin_para "para" )
204+ elseif (ENABLE_OPENMP)
205+ set (_abacus_bin_para "omp" )
230206else ()
231- if (USE_CUDA )
232- if (ENABLE_MPI )
233- set (ABACUS_BIN_NAME abacus_pw_gpu)
234- endif ( )
235- else ( )
236- if (ENABLE_MPI )
237- set (ABACUS_BIN_NAME abacus_pw_para )
238- else ( )
239- set (ABACUS_BIN_NAME abacus_pw_ser )
240- endif ( )
241- endif ( )
207+ set (_abacus_bin_para "ser" )
208+ endif ( )
209+
210+ if (USE_CUDA OR USE_ROCM )
211+ set (_abacus_bin_device "gpu" )
212+ elseif (USE_CUDA_ON_DCU )
213+ set (_abacus_bin_device "dcu" )
214+ elseif (USE_DSP )
215+ set (_abacus_bin_device "dsp" )
216+ elseif (USE_SW )
217+ set (_abacus_bin_device "sw" )
242218endif ()
243219
220+ # if(USE_KML)
221+ # set(_abacus_bin_device "kp")
222+ # endif()
223+
224+ if (_abacus_bin_device)
225+ set (ABACUS_BIN_NAME "abacus_${_abacus_bin_level} _${_abacus_bin_device} " )
226+ else ()
227+ set (ABACUS_BIN_NAME "abacus_${_abacus_bin_level} _${_abacus_bin_para} " )
228+ endif ()
244229
245230# Use DSP hardware
246- if (USE_DSP)
247- if (ENABLE_ELPA)
248- message (WARNING USE_DSP is incompatible with ELPA; switching off ENABLE_ELPA)
249- set (ENABLE_ELPA OFF )
250- endif ()
251- set (ABACUS_BIN_NAME abacus_dsp)
231+ if (USE_DSP AND ENABLE_ELPA)
232+ message (FATAL_ERROR "USE_DSP is incompatible with ELPA." )
252233endif ()
253234
254235list (APPEND CMAKE_MODULE_PATH
@@ -499,6 +480,9 @@ endif()
499480# version. Use cmake with AMD-ROCm:
500481# https://rocmdocs.amd.com/en/latest/Installation_Guide/Using-CMake-with-AMD-ROCm.html
501482if (USE_ROCM)
483+ message (
484+ DEPRECATION
485+ "Option USE_ROCM is deprecated and will be ignored in a future release. " )
502486 cmake_minimum_required (VERSION 3.18 )
503487 if (NOT DEFINED ROCM_PATH)
504488 set (ROCM_PATH
0 commit comments