Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add simple examples and reference numpy scripts #7

Merged
merged 1 commit into from
Dec 7, 2023
Merged

Conversation

yasahi-hpc
Copy link
Collaborator

As a preparation for docs, small examples are added.
Each example includes Kokkos and numpy implementations. For example, 01_1DFFT includes,

  • CMakeLists.txt
  • 01_1DFFT.cpp (KokkosFFT version)
  • numpy_1DFFT.py (numpy version)

*.cpp example is the Kokkos implementation of the numpy script. The backend is chosen based on your choice of compile option for Kokkos, -DKokkos_ENABLE_OPENMP=ON for OpenMP backend, for example.

@yasahi-hpc yasahi-hpc merged commit 0975bc9 into main Dec 7, 2023
2 checks passed
@yasahi-hpc yasahi-hpc deleted the add-examples branch December 7, 2023 17:25
Copy link
Member

@cedricchevalier19 cedricchevalier19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few comments

@@ -4,6 +4,9 @@ project(kokkos-fft LANGUAGES CXX)
# Add cmake helpers for FFTW
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/cmake")

# Options
option(BUILD_EXAMPLES "Build kokkos-fft examples" ON)

find_package(Kokkos CONFIG)
if(NOT kokkos_FOUND)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure about the case ?

Suggested change
if(NOT kokkos_FOUND)
if(NOT Kokkos_FOUND)

@@ -4,6 +4,9 @@ project(kokkos-fft LANGUAGES CXX)
# Add cmake helpers for FFTW
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/cmake")

# Options
option(BUILD_EXAMPLES "Build kokkos-fft examples" ON)

find_package(Kokkos CONFIG)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure it's a good idea to limit to CONFIG?
Some application might have valid reasons to have a custom FindKokkos.cmake.

@@ -0,0 +1,2 @@
add_executable(01_1DFFT 01_1DFFT.cpp)
target_link_libraries(01_1DFFT PUBLIC Kokkos::fft)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we can add examples to be run as tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants