Skip to content

Commit

Permalink
better way to avoid rl_cleanup import fail
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Mar 5, 2019
1 parent ff4a80b commit 52655df
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pycudadecon/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from .version import __version__
from .deconvolution import decon, TemporaryOTF
from .libcudawrapper import RLContext, rl_decon, rl_init
from .libcudawrapper import RLContext, rl_decon, rl_init, rl_cleanup
from .affine import affineGPU, deskewGPU, rotateGPU

__all__ = (decon, TemporaryOTF, RLContext, rl_decon, rl_init,
__all__ = (decon, TemporaryOTF, RLContext, rl_decon, rl_init, rl_cleanup,
affineGPU, deskewGPU, rotateGPU)
2 changes: 2 additions & 0 deletions pycudadecon/libcudawrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@
cuda_reset = cudaLib.cuda_reset

except AttributeError as e:
rl_cleanup = None
cuda_reset = None
logger.warning('Failed to properly import libcudaDeconv')
print(e)

Expand Down
3 changes: 1 addition & 2 deletions test/test_decon.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import unittest
import os
import numpy as np
from pycudadecon import decon, RLContext, rl_init, rl_decon
from pycudadecon.libcudawrapper import rl_cleanup
from pycudadecon import decon, RLContext, rl_init, rl_decon, rl_cleanup
from pycudadecon.util import imread


Expand Down

0 comments on commit 52655df

Please sign in to comment.