Update Kokkos library in LAMMPS to v3.2
This commit is contained in:
@ -1,44 +1,19 @@
|
||||
# Kokkos requires CMake version 3.1 or higher and that you have the following
|
||||
# line with a version of 3.1 or higher as the first line of your project:
|
||||
# cmake_minimum_required(VERSION 3.1)
|
||||
#
|
||||
# The other CMake commands required to build Kokkos as part of your application
|
||||
# are:
|
||||
# add_subdirectory(path/to/kokkos)
|
||||
# target_link_libraries(executable or library)
|
||||
#
|
||||
# If Kokkos is not a subdirectory of your project, you will also need to pass a
|
||||
# binary directory to add_subdirectory(). We had to pass the binary directory
|
||||
# for this example for that reason. Note that target_link_libraries() can be
|
||||
# called on a target added by add_executable(), add_library(), or another
|
||||
# similar command.
|
||||
#
|
||||
# All the flags, etc. required to build using the Kokkos library are
|
||||
# transitively added to targets which depend on the library.
|
||||
#
|
||||
# The CMake variables CMAKE_CXX_STANDARD and CMAKE_CXX_EXTENSIONS are
|
||||
# respected. We recommend that you set CMAKE_CXX_EXTENSIONS to OFF.
|
||||
# Otherwise, CMake defaults to using extensions for the C++ standard, and the
|
||||
# GNU extensions (-std=gnu++11) will be used for compilers that support it
|
||||
# instead of standard C++11 (-std=c++11).
|
||||
#
|
||||
# A bunch of build options are added as variables (all starting with KOKKOS_)
|
||||
# to the build. Check them out using ccmake or the CMake GUI.
|
||||
#
|
||||
# Building this example:
|
||||
# 1. Create a build directory.
|
||||
# 2. cd /path/to/build/directory
|
||||
# 3. cmake /path/to/example
|
||||
# 4. make
|
||||
# Kokkos minimally requires 3.10 right now,
|
||||
# but your project can set it higher
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
project(Example CXX C Fortran)
|
||||
|
||||
list(APPEND CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -O3)
|
||||
# Project can mix languages - must have C++ support
|
||||
# Kokkos flags are only applied to C++ files
|
||||
project(Example CXX)
|
||||
|
||||
# We build kokkos as a subdirectory of our project
|
||||
add_subdirectory(${Example_SOURCE_DIR}/../.. ${Example_BINARY_DIR}/kokkos)
|
||||
|
||||
include_directories(${Kokkos_INCLUDE_DIRS_RET})
|
||||
add_executable(example cmake_example.cpp)
|
||||
|
||||
add_executable(example cmake_example.cpp foo.f)
|
||||
target_link_libraries(example kokkos)
|
||||
# This is the only line required to set up all compiler/linker flags
|
||||
target_link_libraries(example Kokkos::kokkos)
|
||||
|
||||
# Adds a test for the executable
|
||||
enable_testing()
|
||||
add_test(NAME KokkosInTree_Verify COMMAND example 10)
|
||||
|
||||
@ -45,8 +45,6 @@
|
||||
#include <Kokkos_Core.hpp>
|
||||
#include <cstdio>
|
||||
|
||||
extern "C" void print_fortran_();
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
Kokkos::initialize(argc, argv);
|
||||
Kokkos::DefaultExecutionSpace::print_configuration(std::cout);
|
||||
@ -84,8 +82,6 @@ int main(int argc, char* argv[]) {
|
||||
count_time = timer.seconds();
|
||||
printf("Sequential: %ld %10.6f\n", seq_count, count_time);
|
||||
|
||||
print_fortran_();
|
||||
|
||||
Kokkos::finalize();
|
||||
|
||||
return (count == seq_count) ? 0 : -1;
|
||||
|
||||
@ -1,4 +0,0 @@
|
||||
FUNCTION print_fortran()
|
||||
PRINT *, 'Hello World from Fortran'
|
||||
RETURN
|
||||
END
|
||||
Reference in New Issue
Block a user