-
Notifications
You must be signed in to change notification settings - Fork 175
[DFT] Introduce the cuFFT backend for the DFT interface. #284
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
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
004b2d4
[DFT] Rearrange DFT compute tests so unimplemented always skips (#311)
FMarno 6b76512
Initial cuFFT integration
FMarno 1f1bf61
throw from host task directly
FMarno ca49074
remove detail namespace where possible
FMarno 12630a0
format
FMarno 719b0e1
update after rebase
FMarno 1c53bfd
style change
FMarno 12d2e9f
Implemented all cufft execution functions
FMarno 4860fdd
Increase the relative error margin so cufft backend passes tests
FMarno 121f554
Fix swapped input and output strides
FMarno 46b51b3
fix compile-time tests for cufft
FMarno 2110c2e
fix macro typo
FMarno 3128522
fix non cuda build and increase test accuracy error margin
FMarno a9d8154
update README
FMarno 745f332
format with clang-format-10
FMarno 0d006c4
enable recommit in cuda backend
FMarno 14dda42
change cuda context after call to cufftDestroy
FMarno 00ff378
update dft example cmake
FMarno e70a4a6
update example readme
FMarno 8df0fee
typo in ENABLE_CUFFT_BACKEND description
FMarno 4f63869
Update help text for the various backends
FMarno 87cdf0d
use the correct copyright headers
FMarno 5e13967
Fix cmake comment
FMarno d4465d8
fix binary name in example
FMarno bd503eb
Add an exception for when the user tries to scale with cufft
FMarno 0d7fdd5
fix warnings
FMarno 4b1d0b1
removed forward_scale in runtime example for cufft
FMarno 82639ca
avoid creating plans with invalid strides
FMarno File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| /******************************************************************************* | ||
| * Copyright Codeplay Software Ltd | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions | ||
| * and limitations under the License. | ||
| * | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| *******************************************************************************/ | ||
|
|
||
| #ifndef _ONEMKL_DFT_CUFFT_HPP_ | ||
| #define _ONEMKL_DFT_CUFFT_HPP_ | ||
|
|
||
| #if __has_include(<sycl/sycl.hpp>) | ||
| #include <sycl/sycl.hpp> | ||
| #else | ||
| #include <CL/sycl.hpp> | ||
| #endif | ||
|
|
||
| #include "oneapi/mkl/detail/export.hpp" | ||
| #include "oneapi/mkl/dft/detail/types_impl.hpp" | ||
|
|
||
| namespace oneapi::mkl::dft { | ||
|
|
||
| namespace detail { | ||
| // Forward declarations | ||
| template <precision prec, domain dom> | ||
| class commit_impl; | ||
|
|
||
| template <precision prec, domain dom> | ||
| class descriptor; | ||
| } // namespace detail | ||
|
|
||
| namespace cufft { | ||
| #include "oneapi/mkl/dft/detail/dft_ct.hxx" | ||
| } // namespace cufft | ||
|
|
||
| } // namespace oneapi::mkl::dft | ||
|
|
||
| #endif // _ONEMKL_DFT_CUFFT_HPP_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| #=============================================================================== | ||
| # Copyright Codeplay Software Ltd | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions | ||
| # and limitations under the License. | ||
| # | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| #=============================================================================== | ||
|
|
||
| set(LIB_NAME onemkl_dft_cufft) | ||
| set(LIB_OBJ ${LIB_NAME}_obj) | ||
|
|
||
| find_package(CUDAToolkit REQUIRED) | ||
|
|
||
| add_library(${LIB_NAME}) | ||
| add_library(${LIB_OBJ} OBJECT | ||
| descriptor.cpp | ||
| commit.cpp | ||
| forward.cpp | ||
| backward.cpp | ||
| compute_signature.cpp | ||
| $<$<BOOL:${BUILD_SHARED_LIBS}>: mkl_dft_cufft_wrappers.cpp> | ||
| ) | ||
|
|
||
| target_include_directories(${LIB_OBJ} | ||
| PRIVATE ${PROJECT_SOURCE_DIR}/include | ||
| ${PROJECT_SOURCE_DIR}/src | ||
| ${CMAKE_BINARY_DIR}/bin | ||
| ${MKL_INCLUDE} | ||
| ) | ||
|
|
||
| target_compile_options(${LIB_OBJ} PRIVATE ${ONEMKL_BUILD_COPT} ${MKL_COPT}) | ||
|
|
||
| target_link_libraries(${LIB_OBJ} PRIVATE CUDA::cufft CUDA::cuda_driver) | ||
|
|
||
| target_link_libraries(${LIB_OBJ} PUBLIC ONEMKL::SYCL::SYCL ${MKL_LINK_SYCL}) | ||
|
|
||
| set_target_properties(${LIB_OBJ} PROPERTIES | ||
| POSITION_INDEPENDENT_CODE ON | ||
| ) | ||
| target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) | ||
|
|
||
| #Set oneMKL libraries as not transitive for dynamic | ||
| if(BUILD_SHARED_LIBS) | ||
| set_target_properties(${LIB_NAME} PROPERTIES | ||
| INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL | ||
| ) | ||
| endif() | ||
|
|
||
| # Add major version to the library | ||
| set_target_properties(${LIB_NAME} PROPERTIES | ||
| SOVERSION ${PROJECT_VERSION_MAJOR} | ||
| ) | ||
|
|
||
| # Add dependencies rpath to the library | ||
| list(APPEND CMAKE_BUILD_RPATH $<TARGET_FILE_DIR:${LIB_NAME}>) | ||
|
|
||
| # Add the library to install package | ||
| install(TARGETS ${LIB_OBJ} EXPORT oneMKLTargets) | ||
| install(TARGETS ${LIB_NAME} EXPORT oneMKLTargets | ||
| RUNTIME DESTINATION bin | ||
| ARCHIVE DESTINATION lib | ||
| LIBRARY DESTINATION lib | ||
| ) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.