diff --git a/advanced_examples/04_unmanaged_aosoa/CMakeLists.txt b/advanced_examples/04_unmanaged_aosoa/CMakeLists.txt index da97bb0..a66bb09 100644 --- a/advanced_examples/04_unmanaged_aosoa/CMakeLists.txt +++ b/advanced_examples/04_unmanaged_aosoa/CMakeLists.txt @@ -1,12 +1,5 @@ -add_executable(ForParallelForUnmanaged Fortran_main.F90 Fortran_kernels.F90 parallel_for_example.cpp) -target_link_libraries(ForParallelForUnmanaged Cabana::cabanacore ${MPI_Fortran_LIBRARIES}) -add_test(NAME Fortran_advance_example_04 COMMAND ForParallelForUnmanaged) -set_property(TARGET ForParallelForUnmanaged PROPERTY LINKER_LANGUAGE Fortran) -add_definitions(${MPI_Fortran_COMPILE_FLAGS}) -include_directories(${MPI_Fortran_INCLUDE_PATH} ${CMAKE_CURRENT_BINARY_DIR}/../Fortran_features) -link_directories(${MPI_Fortran_LIBRARIES}) - message(${CMAKE_Fortran_COMPILER_ID}) +message(Kokkos_ENABLE_CUDA) if (("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "PGI") AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "PGI")) if( Kokkos_ENABLE_CUDA ) target_compile_definitions(ForParallelForUnmanaged PUBLIC -DUSE_GPU=1) @@ -19,7 +12,7 @@ if (("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "PGI") AND ("${CMAKE_CXX_COMPILER_I target_compile_definitions(ForParallelForUnmanaged PUBLIC -DUSE_GPU=0) set(CMAKE_Fortran_FLAGS "-ta=host") endif() - + set(CMAKE_EXE_LINKER_FLAGS "-pgc++libs") else() if( Kokkos_ENABLE_CUDA ) @@ -34,3 +27,11 @@ else() target_compile_definitions(ForParallelForUnmanaged PUBLIC -DUSE_GPU=0) endif() endif() + +add_executable(ForParallelForUnmanaged Fortran_main.F90 Fortran_kernels.F90 parallel_for_example.cpp) +target_link_libraries(ForParallelForUnmanaged Cabana::cabanacore ${MPI_Fortran_LIBRARIES}) +add_test(NAME Fortran_advance_example_04 COMMAND ForParallelForUnmanaged) +set_property(TARGET ForParallelForUnmanaged PROPERTY LINKER_LANGUAGE Fortran) +add_definitions(${MPI_Fortran_COMPILE_FLAGS}) +include_directories(${MPI_Fortran_INCLUDE_PATH} ${CMAKE_CURRENT_BINARY_DIR}/../Fortran_features) +link_directories(${MPI_Fortran_LIBRARIES})