-
Notifications
You must be signed in to change notification settings - Fork 175
[DFT] Add rocFFT backend for DFT interface #330
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
10 commits
Select commit
Hold shift + click to select a range
24ec063
Add rocfft backend
FMarno 5f1e358
avoid creating plans with invalid strides
FMarno e5f588d
update example
FMarno 839ce15
Update readme to show rocfft support
FMarno 1447da9
Update product and version information
FMarno 4cdea13
increase tolerances
FMarno 65fc74b
update README
FMarno 838dcae
formatting changes
FMarno 2ce249d
fix unique_ptr creation
FMarno 0617a56
Apply rule of three to rocfft commit class
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
49 changes: 49 additions & 0 deletions
49
include/oneapi/mkl/dft/detail/rocfft/onemkl_dft_rocfft.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
| 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_ROCFFT_HPP_ | ||
| #define _ONEMKL_DFT_ROCFFT_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 rocfft { | ||
| #include "oneapi/mkl/dft/detail/dft_ct.hxx" | ||
| } // namespace rocfft | ||
|
|
||
| } // namespace oneapi::mkl::dft | ||
|
|
||
| #endif // _ONEMKL_DFT_ROCFFT_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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| #=============================================================================== | ||
| # 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_rocfft) | ||
| set(LIB_OBJ ${LIB_NAME}_obj) | ||
|
|
||
|
|
||
| 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_rocfft_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}) | ||
|
|
||
| find_package(HIP REQUIRED) | ||
| find_package(rocfft REQUIRED) | ||
|
|
||
| target_link_libraries(${LIB_OBJ} PRIVATE hip::host roc::rocfft) | ||
|
|
||
| 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.