-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'flatiron/master' into perftests
- Loading branch information
Showing
12 changed files
with
106 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
add_library(directft OBJECT | ||
directft/dirft1d.f directft/dirft1df.f | ||
directft/dirft2d.f directft/dirft2df.f | ||
directft/dirft3d.f directft/dirft3df.f) | ||
add_library( | ||
directft OBJECT directft/dirft1d.f directft/dirft1df.f directft/dirft2d.f | ||
directft/dirft2df.f directft/dirft3d.f directft/dirft3df.f) | ||
|
||
set(FORTRAN_EXAMPLES guru1d1 nufft1d_demo nufft2d_demo nufft2dmany_demo nufft3d_demo simple1d1) | ||
set(FORTRAN_EXAMPLES guru1d1 nufft1d_demo nufft2d_demo nufft2dmany_demo | ||
nufft3d_demo simple1d1) | ||
|
||
foreach(EXAMPLE ${FORTRAN_EXAMPLES}) | ||
add_executable(fort_${EXAMPLE} examples/${EXAMPLE}.f) | ||
add_executable(fort_${EXAMPLE}f examples/${EXAMPLE}f.f) | ||
add_executable(fort_${EXAMPLE} examples/${EXAMPLE}.f) | ||
add_executable(fort_${EXAMPLE}f examples/${EXAMPLE}f.f) | ||
|
||
target_link_libraries(fort_${EXAMPLE} PRIVATE directft finufft) | ||
target_link_libraries(fort_${EXAMPLE}f PRIVATE directft finufft) | ||
target_link_libraries(fort_${EXAMPLE} PRIVATE directft finufft | ||
${FINUFFT_FFTLIBS}) | ||
target_link_libraries(fort_${EXAMPLE}f PRIVATE directft finufft | ||
${FINUFFT_FFTLIBS}) | ||
endforeach() |
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,25 @@ | ||
import pytest | ||
|
||
import numpy as np | ||
from ctypes.util import find_library | ||
|
||
|
||
# Check to make sure the fallback mechanism works if there is no bundled | ||
# dynamic library. | ||
@pytest.mark.skip(reason="Patching seems to fail in CI") | ||
def test_fallback(mocker): | ||
def fake_load_library(lib_name, path): | ||
if lib_name in ["libcufinufft", "cufinufft"]: | ||
raise OSError() | ||
else: | ||
return np.ctypeslib.load_library(lib_name, path) | ||
|
||
# Block out the bundled library. | ||
mocker.patch("numpy.ctypeslib.load_library", fake_load_library) | ||
|
||
# Make sure an error is raised if no system library is found. | ||
if find_library("cufinufft") is None: | ||
with pytest.raises(ImportError, match="suitable cufinufft"): | ||
import cufinufft | ||
else: | ||
import cufinufft |
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,20 @@ | ||
import pytest | ||
|
||
import numpy as np | ||
from ctypes.util import find_library | ||
|
||
@pytest.mark.skip(reason="Patching seems to fail in CI") | ||
def test_fallback(mocker): | ||
def fake_load_library(lib_name, path): | ||
if lib_name in ["libfinufft", "finufft"]: | ||
raise OSError() | ||
else: | ||
return np.ctypeslib.load_library(lib_name, path) | ||
|
||
mocker.patch("numpy.ctypeslib.load_library", fake_load_library) | ||
|
||
if find_library("finufft") is None: | ||
with pytest.raises(ImportError, match="suitable finufft"): | ||
import finufft | ||
else: | ||
import finufft |
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