-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved cufft extension into separate module (#390)
* moved cufft extension into separate module * cleaning up
- Loading branch information
Showing
15 changed files
with
48 additions
and
45 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,45 @@ | ||
#!/usr/bin/env python | ||
|
||
# we should aim to remove the distutils dependency | ||
import setuptools | ||
from distutils.core import setup, Extension | ||
import os | ||
|
||
ext_modules = [] | ||
cmdclass = {} | ||
# filtered Cuda FFT extension module | ||
try: | ||
from extensions import locate_cuda, get_cuda_version # this raises an error if pybind11 is not available | ||
CUDA = locate_cuda() # this raises an error if CUDA is not available | ||
CUDA_VERSION = get_cuda_version(CUDA['nvcc']) | ||
if CUDA_VERSION < 10: | ||
raise ValueError("filtered cufft requires CUDA >= 10") | ||
from extensions import CustomBuildExt | ||
cufft_dir = "filtered_fft" | ||
ext_modules.append( | ||
Extension("filtered_cufft", | ||
sources=[os.path.join(cufft_dir, "module.cpp"), | ||
os.path.join(cufft_dir, "filtered_fft.cu")] | ||
) | ||
) | ||
cmdclass = {"build_ext": CustomBuildExt} | ||
EXTBUILD_MESSAGE = "The filtered cufft extension has been successfully installed.\n" | ||
except: | ||
EXTBUILD_MESSAGE = '*' * 75 + "\n" | ||
EXTBUILD_MESSAGE += "Could not install the filtered cufft extension.\n" | ||
EXTBUILD_MESSAGE += "Make sure to have CUDA >= 10 and pybind11 installed.\n" | ||
EXTBUILD_MESSAGE += '*' * 75 + "\n" | ||
|
||
exclude_packages = [] | ||
package_list = setuptools.find_packages(exclude=exclude_packages) | ||
setup( | ||
name='filtered cufft', | ||
version=0.1, | ||
author='Bjoern Enders, Benedikt Daurer, Joerg Lotze', | ||
description='Extension of CuFFT to include pre- and post-filters using callbacks', | ||
packages=package_list, | ||
ext_modules=ext_modules, | ||
cmdclass=cmdclass | ||
) | ||
|
||
print(EXTBUILD_MESSAGE) |
Empty file.
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