forked from uxlfoundation/oneMath
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DFT] Introduce the cuFFT backend for the DFT interface. (uxlfoundati…
…on#284) * [DFT] Rearrange DFT compute tests so unimplemented always skips (uxlfoundation#311) * rearrange tests so unimplemented always skips * wait to wait_and_throw, detect skipped tests * Initial cuFFT integration Currently only has support for inplace complex-to-complex single precision transforms * throw from host task directly * remove detail namespace where possible * format * update after rebase * style change * Implemented all cufft execution functions * Increase the relative error margin so cufft backend passes tests * Fix swapped input and output strides * fix compile-time tests for cufft * fix macro typo * fix non cuda build and increase test accuracy error margin * update README * format with clang-format-10 * enable recommit in cuda backend * change cuda context after call to cufftDestroy * update dft example cmake * update example readme * typo in ENABLE_CUFFT_BACKEND description * Update help text for the various backends * use the correct copyright headers * Fix cmake comment * fix binary name in example * Add an exception for when the user tries to scale with cufft * fix warnings * removed forward_scale in runtime example for cufft * avoid creating plans with invalid strides
- Loading branch information
1 parent
e7776ac
commit f616e8f
Showing
28 changed files
with
1,137 additions
and
51 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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 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 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 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 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.