add gt port of mpi_daxpy
This commit is contained in:
30
CMakeLists.txt
Normal file
30
CMakeLists.txt
Normal file
@@ -0,0 +1,30 @@
|
||||
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
|
||||
|
||||
# create project
|
||||
project(mpi-daxpy-test)
|
||||
|
||||
set(GTENSOR_ENABLE_BLAS ON CACHE BOOL "Enable gtblas")
|
||||
|
||||
# add dependencies
|
||||
include(cmake/CPM.cmake)
|
||||
CPMFindPackage(NAME gtensor
|
||||
GITHUB_REPOSITORY wdmapp/gtensor
|
||||
GIT_TAG main
|
||||
OPTIONS "GTENSOR_ENABLE_BLAS ON")
|
||||
|
||||
find_package(MPI REQUIRED)
|
||||
|
||||
add_executable(mpi_daxpy_gt)
|
||||
target_sources(mpi_daxpy_gt PRIVATE mpi_daxpy_gt.cc)
|
||||
target_link_libraries(mpi_daxpy_gt gtensor::gtensor)
|
||||
target_link_libraries(mpi_daxpy_gt MPI::MPI_CXX)
|
||||
|
||||
if ("${GTENSOR_DEVICE}" STREQUAL "cuda")
|
||||
set_source_files_properties(mpi_daxpy_gt.cc
|
||||
TARGET_DIRECTORY mpi_daxpy_gt
|
||||
PROPERTIES LANGUAGE CUDA)
|
||||
else()
|
||||
set_source_files_properties(mpi_daxpy_gt.cc
|
||||
TARGET_DIRECTORY mpi_daxpy_gt
|
||||
PROPERTIES LANGUAGE CXX)
|
||||
endif()
|
||||
Reference in New Issue
Block a user