Skip to content

Commit

Permalink
Merge pull request #6 from sitic/master
Browse files Browse the repository at this point in the history
Fix CUDA 11 LaunchError
  • Loading branch information
theHamsta committed Feb 20, 2023
2 parents f669d61 + 5037364 commit a42e0da
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion farneback3d/_filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def _call_smooth_cuda_gauss(gpuimg, gpuresult, sigma, kernelsize, filter_mask=N


def smooth_cuda_gauss(img, sigma, kernelsize, rtn_gpu=None, filter_mask=None):
if not rtn_gpu:
if rtn_gpu is None:
rtn_gpu = gpuarray.GPUArray(img.shape, np.float32)

if isinstance(img, np.ndarray):
Expand Down
4 changes: 2 additions & 2 deletions farneback3d/filtering.cu
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ __global__ void convolve3d_gauss(float *__restrict__ in,
float sigmaX,
float sigmaY,
float sigmaZ,
bool filterNonZerosOnly)
int filterNonZerosOnly)
{
int x = blockIdx.x * blockDim.x + threadIdx.x;
int y = blockIdx.y * blockDim.y + threadIdx.y;
Expand Down Expand Up @@ -114,7 +114,7 @@ __global__ void convolve3d_gauss_with_mask(float *__restrict__ in,
float sigmaX,
float sigmaY,
float sigmaZ,
bool filterNonZerosOnly)
int filterNonZerosOnly)
{
int x = blockIdx.x * blockDim.x + threadIdx.x;
int y = blockIdx.y * blockDim.y + threadIdx.y;
Expand Down
8 changes: 4 additions & 4 deletions tests/test_synthetic_volumes.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ def test_moving_cube_larger_distance():

def test_default_values():

a = np.ones([20] * 3)
b = np.ones([20] * 3)
a = np.ones([20] * 3, dtype=np.float32)
b = np.ones([20] * 3, dtype=np.float32)

optflow = farneback3d.Farneback()

Expand All @@ -67,6 +67,6 @@ def test_default_values():


if __name__ == "__main__":
# test_moving_cube()
# test_moving_cube_larger_distance()
test_moving_cube()
test_moving_cube_larger_distance()
test_default_values()

0 comments on commit a42e0da

Please sign in to comment.