Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion cmake-format.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# Do not prettify comments
# Workaround due to cmake-format bug; should use "--enable-markup=false" in args instead
markup:
enable_markup: false

# Make self-defined testing helper happy
parse:
additional_commands:
addtest:
kwargs:
TARGET: 1
SOURCES: '+'
LIBS: '*'
172 changes: 84 additions & 88 deletions source/source_base/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,91 +1,85 @@
if (ENABLE_ABACUS_LIBM)
list (APPEND LIBM_SRC
libm/branred.cpp
libm/cexp.cpp
libm/exp.cpp
libm/sincos.cpp
)
if(ENABLE_ABACUS_LIBM)
list(APPEND LIBM_SRC libm/branred.cpp libm/cexp.cpp libm/exp.cpp
Comment thread
Growl1234 marked this conversation as resolved.
libm/sincos.cpp)
endif()
add_library(
base
OBJECT
assoc_laguerre.cpp
module_external/blas_connector_base.cpp
module_external/blas_connector_vector.cpp
module_external/blas_connector_matrix.cpp
clebsch_gordan_coeff.cpp
complexarray.cpp
complexmatrix.cpp
element_basis_index.cpp
inverse_matrix.cpp
gather_math_lib_info.cpp
global_file.cpp
global_function.cpp
glob_fn_ddotreal.cpp
global_variable.cpp
intarray.cpp
math_integral.cpp
math_lebedev_laikov.cpp
math_polyint.cpp
math_sphbes.cpp
math_erf_complex.cpp
math_ylmreal.cpp
math_bspline.cpp
math_chebyshev.cpp
mathzone_add1.cpp
matrix.cpp
matrix3.cpp
memory_recorder.cpp
mymath.cpp
opt_cg.cpp
opt_dcsrch.cpp
opt_tn.cpp
output.cpp
para_gemm.cpp
realarray.cpp
sph_bessel_rec_d1.cpp
sph_bessel_rec_d2.cpp
timer.cpp
tool_check.cpp
tool_quit.cpp
tool_title.cpp
ylm.cpp
parallel_common.cpp
parallel_cell.cpp
parallel_global.cpp
parallel_comm.cpp
parallel_reduce.cpp
parallel_device.cpp
parallel_grid.cpp
sph_bessel_tf.cpp
cubic_spline.cpp
parallel_2d.cpp
module_out/binstream.cpp
module_out/filename.cpp
module_out/sparse_matrix.cpp
module_out/file_reader.cpp
module_out/csr_reader.cpp
module_out/read_exit_file.cpp
module_out/orb_io.cpp
module_mixing/mixing_data.cpp
module_mixing/mixing.cpp
module_mixing/plain_mixing.cpp
module_mixing/pulay_mixing.cpp
module_mixing/broyden_mixing.cpp
module_parallel/para_world.cpp
module_parallel/para_band_output.cpp
module_parallel/para_collection.cpp
module_parallel/para_kmesh_world.cpp
module_parallel/para_pw_world.cpp
module_parallel/para_diag_world.cpp
module_parallel/para_rgrid_world.cpp
module_parallel/para_bgroup_world.cpp
module_parallel/para_matrix_world.cpp
module_parallel/para_mpi_func.cpp
module_parallel/para_setup.cpp
module_parallel/para_bridge.cpp
${LIBM_SRC}
)
base OBJECT
assoc_laguerre.cpp
module_external/blas_connector_base.cpp
module_external/blas_connector_vector.cpp
module_external/blas_connector_matrix.cpp
clebsch_gordan_coeff.cpp
complexarray.cpp
complexmatrix.cpp
element_basis_index.cpp
inverse_matrix.cpp
gather_math_lib_info.cpp
global_file.cpp
global_function.cpp
glob_fn_ddotreal.cpp
global_variable.cpp
intarray.cpp
math_integral.cpp
math_lebedev_laikov.cpp
math_polyint.cpp
math_sphbes.cpp
math_erf_complex.cpp
math_ylmreal.cpp
math_bspline.cpp
math_chebyshev.cpp
mathzone_add1.cpp
matrix.cpp
matrix3.cpp
memory_recorder.cpp
mymath.cpp
opt_cg.cpp
opt_dcsrch.cpp
opt_tn.cpp
output.cpp
para_gemm.cpp
realarray.cpp
sph_bessel_rec_d1.cpp
sph_bessel_rec_d2.cpp
timer.cpp
tool_check.cpp
tool_quit.cpp
tool_title.cpp
ylm.cpp
parallel_common.cpp
parallel_cell.cpp
parallel_global.cpp
parallel_comm.cpp
parallel_reduce.cpp
parallel_device.cpp
parallel_grid.cpp
sph_bessel_tf.cpp
cubic_spline.cpp
parallel_2d.cpp
module_out/binstream.cpp
module_out/filename.cpp
module_out/sparse_matrix.cpp
module_out/file_reader.cpp
module_out/csr_reader.cpp
module_out/read_exit_file.cpp
module_out/orb_io.cpp
module_mixing/mixing_data.cpp
module_mixing/mixing.cpp
module_mixing/plain_mixing.cpp
module_mixing/pulay_mixing.cpp
module_mixing/broyden_mixing.cpp
module_parallel/para_world.cpp
module_parallel/para_band_output.cpp
module_parallel/para_collection.cpp
module_parallel/para_kmesh_world.cpp
module_parallel/para_pw_world.cpp
module_parallel/para_diag_world.cpp
module_parallel/para_rgrid_world.cpp
module_parallel/para_bgroup_world.cpp
module_parallel/para_matrix_world.cpp
module_parallel/para_mpi_func.cpp
module_parallel/para_setup.cpp
module_parallel/para_bridge.cpp
${LIBM_SRC})

target_link_libraries(base PUBLIC container)
add_subdirectory(module_container)
Expand All @@ -95,15 +89,17 @@ if(ENABLE_COVERAGE)
endif()

if(BUILD_TESTING)
if(ENABLE_MPI) #Zhang Xiaoyang: A temporary solution. Please classify the serial and parrallel tests later. 2024-7-8
if(ENABLE_MPI)

#Zhang Xiaoyang: A temporary solution. Please classify the serial and parrallel tests later. 2024-7-8
add_subdirectory(test)
add_subdirectory(test_parallel)
add_subdirectory(kernels/test)
add_subdirectory(module_mixing/test)
add_subdirectory(module_device/test)
add_subdirectory(module_grid/test)
add_subdirectory(module_parallel/test)
if (ENABLE_ABACUS_LIBM)
if(ENABLE_ABACUS_LIBM)
add_subdirectory(libm/test)
endif()
endif()
Expand Down
9 changes: 4 additions & 5 deletions source/source_base/kernels/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
abacus_disable_feature_definitions(__MPI)

AddTest(
TARGET MODULE_BASE_KERNELS_Unittests
LIBS parameter base device
SOURCES math_ylm_op_test.cpp math_kernel_test.cpp
)
addtest(
TARGET MODULE_BASE_KERNELS_Unittests
LIBS parameter base device
SOURCES math_ylm_op_test.cpp math_kernel_test.cpp)
12 changes: 3 additions & 9 deletions source/source_base/libm/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
abacus_disable_feature_definitions(__MPI)

AddTest(
TARGET MODULE_BASE_LIBM_UTs
SOURCES libm_test.cpp
../branred.cpp
../cexp.cpp
../exp.cpp
../sincos.cpp
)

addtest(TARGET MODULE_BASE_LIBM_UTs
SOURCES libm_test.cpp ../branred.cpp ../cexp.cpp ../exp.cpp
../sincos.cpp)
4 changes: 3 additions & 1 deletion source/source_base/module_container/ATen/core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
file(GLOB ATen_CORE_SRCS "*.cpp")
set(ATen_CPU_SRCS ${ATen_CPU_SRCS} ${ATen_CORE_SRCS} PARENT_SCOPE)
set(ATen_CPU_SRCS
${ATen_CPU_SRCS} ${ATen_CORE_SRCS}
PARENT_SCOPE)
16 changes: 11 additions & 5 deletions source/source_base/module_container/ATen/kernels/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
file(GLOB ATen_KERNELS_SRCS "*.cpp")

if(USE_CUDA)
file(GLOB ATen_KERNELS_CUDA_SRCS "cuda/*.cu")
set(ATen_CUDA_SRCS ${ATen_CUDA_SRCS} ${ATen_KERNELS_CUDA_SRCS} PARENT_SCOPE)
file(GLOB ATen_KERNELS_CUDA_SRCS "cuda/*.cu")
set(ATen_CUDA_SRCS
${ATen_CUDA_SRCS} ${ATen_KERNELS_CUDA_SRCS}
PARENT_SCOPE)
endif()

if(USE_ROCM)
file(GLOB ATen_KERNELS_ROCM_SRCS "rocm/*.hip.cu")
set(ATen_ROCM_SRCS ${ATen_ROCM_SRCS} ${ATen_KERNELS_ROCM_SRCS} PARENT_SCOPE)
file(GLOB ATen_KERNELS_ROCM_SRCS "rocm/*.hip.cu")
set(ATen_ROCM_SRCS
${ATen_ROCM_SRCS} ${ATen_KERNELS_ROCM_SRCS}
PARENT_SCOPE)
endif()

set(ATen_CPU_SRCS ${ATen_CPU_SRCS} ${ATen_KERNELS_SRCS} PARENT_SCOPE)
set(ATen_CPU_SRCS
${ATen_CPU_SRCS} ${ATen_KERNELS_SRCS}
PARENT_SCOPE)

if(BUILD_TESTING)
if(ENABLE_MPI)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
AddTest(
addtest(
TARGET MODULE_BASE_container_kernels_uts
LIBS parameter
SOURCES blas_test.cpp lapack_test.cpp
memory_test.cpp linalg_test.cpp
)
SOURCES blas_test.cpp lapack_test.cpp memory_test.cpp linalg_test.cpp)

target_link_libraries(MODULE_BASE_container_kernels_uts PRIVATE container base device)
target_link_libraries(MODULE_BASE_container_kernels_uts PRIVATE container base
Comment thread
Growl1234 marked this conversation as resolved.
device)
12 changes: 7 additions & 5 deletions source/source_base/module_container/ATen/ops/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
file(GLOB ATen_OPS_SRCS "*.cpp")

set(ATen_CPU_SRCS ${ATen_CPU_SRCS} ${ATen_OPS_SRCS} PARENT_SCOPE)
set(ATen_CPU_SRCS
${ATen_CPU_SRCS} ${ATen_OPS_SRCS}
PARENT_SCOPE)

if(BUILD_TESTING)
if(ENABLE_MPI)
add_subdirectory(test)
endif()
endif()
if(ENABLE_MPI)
add_subdirectory(test)
endif()
endif()
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
AddTest(
addtest(
TARGET MODULE_BASE_container_ops_uts
LIBS parameter
SOURCES einsum_op_test.cpp linalg_op_test.cpp ../../kernels/lapack.cpp
)
SOURCES einsum_op_test.cpp linalg_op_test.cpp ../../kernels/lapack.cpp)

target_link_libraries(MODULE_BASE_container_ops_uts PRIVATE container base device)
target_link_libraries(MODULE_BASE_container_ops_uts PRIVATE container base
device)
Comment thread
Growl1234 marked this conversation as resolved.
5 changes: 3 additions & 2 deletions source/source_base/module_container/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ endif()

add_library(container STATIC ${ATen_CPU_SRCS} ${ATen_CUDA_SRCS})

target_link_libraries(container PUBLIC
${ATen_CPU_DEPENDENCY_LIBS} ${ATen_CUDA_DEPENDENCY_LIBS} ${ATen_ROCM_DEPENDENCY_LIBS})
target_link_libraries(
container PUBLIC ${ATen_CPU_DEPENDENCY_LIBS} ${ATen_CUDA_DEPENDENCY_LIBS}
${ATen_ROCM_DEPENDENCY_LIBS})

if(ENABLE_COVERAGE)
add_coverage(container)
Expand Down
15 changes: 6 additions & 9 deletions source/source_base/module_container/base/core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
set(BASE_CORE_CPU_SRCS
base/core/refcount.cpp
base/core/cpu_allocator.cpp
)
set(BASE_CORE_CPU_SRCS base/core/refcount.cpp base/core/cpu_allocator.cpp)

if (USE_CUDA OR USE_ROCM)
list(APPEND BASE_CORE_CPU_SRCS
base/core/gpu_allocator.cpp
)
if(USE_CUDA OR USE_ROCM)
list(APPEND BASE_CORE_CPU_SRCS base/core/gpu_allocator.cpp)
endif()

set(ATen_CPU_SRCS ${ATen_CPU_SRCS} ${BASE_CORE_CPU_SRCS} PARENT_SCOPE)
set(ATen_CPU_SRCS
${ATen_CPU_SRCS} ${BASE_CORE_CPU_SRCS}
PARENT_SCOPE)
13 changes: 8 additions & 5 deletions source/source_base/module_container/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
abacus_disable_feature_definitions(__MPI)

AddTest(
addtest(
TARGET MODULE_BASE_CONTAINER_Unittests
LIBS parameter container base device
SOURCES tensor_test.cpp tensor_shape_test.cpp allocator_test.cpp
tensor_buffer_test.cpp tensor_map_test.cpp
tensor_utils_test.cpp tensor_accessor_test.cpp
)
SOURCES tensor_test.cpp
tensor_shape_test.cpp
allocator_test.cpp
tensor_buffer_test.cpp
tensor_map_test.cpp
tensor_utils_test.cpp
tensor_accessor_test.cpp)
13 changes: 6 additions & 7 deletions source/source_base/module_device/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@
# )
# endif()


# if(USE_ROCM)
# hip_add_library(module_device_rocm STATIC
# rocm/memory_op.hip.cu
# )
# target_link_libraries(
# device
# module_device_rocm
# device
# module_device_rocm
# hip::host
# hip::device
# hip::hipfft
Expand All @@ -29,16 +28,16 @@

# if(USE_CUDA)
# target_link_libraries(
# device
# device
# )
# elseif(USE_ROCM)
# target_link_libraries(
# device
# device_rocm
# device
# device_rocm
# hip::host
# hip::device
# hip::hipfft
# roc::hipblas
# roc::hipsolver
# )
# endif()
# endif()
Loading
Loading