9898function _fft! (output:: DMatrix{T} , input:: DMatrix{T} , dims= (1 , 2 )) where T
9999 N = size (input, 1 )
100100 np = length (Dagger. compatible_processors ())
101- A = zeros (Blocks (N, div (N, np)), T, size (input))
101+ A = zeros (Blocks (N, cld (N, np)), T, size (input))
102102 copyto! (A, input)
103- B = zeros (Blocks (div (N, np), N), T, size (input))
103+ B = zeros (Blocks (cld (N, np), N), T, size (input))
104104 __fft! (A, B, dims)
105105 copyto! (output, B)
106106 return output
107107end
108108function _ifft! (output:: DMatrix{T} , input:: DMatrix{T} , dims= (1 , 2 )) where T
109109 N = size (input, 1 )
110110 np = length (Dagger. compatible_processors ())
111- A = zeros (Blocks (N, div (N, np)), T, size (input))
111+ A = zeros (Blocks (N, cld (N, np)), T, size (input))
112112 copyto! (A, input)
113- B = zeros (Blocks (div (N, np), N), T, size (input))
113+ B = zeros (Blocks (cld (N, np), N), T, size (input))
114114 __ifft! (A, B, dims)
115115 copyto! (output, B)
116116 return output
@@ -121,16 +121,16 @@ function _fft!(output::DArray{T,3}, input::DArray{T,3}, dims=(1, 2, 3); decomp::
121121 N = size (input, 1 )
122122 np = length (Dagger. compatible_processors ())
123123 if decomp isa Pencil
124- A = zeros (Blocks (N, div (N, np), div (N, np)), T, size (input))
125- B = zeros (Blocks (div (N, np), N, div (N, np)), T, size (input))
126- C = zeros (Blocks (div (N, np), div (N, np), N), T, size (input))
124+ A = zeros (Blocks (N, cld (N, np), cld (N, np)), T, size (input))
125+ B = zeros (Blocks (cld (N, np), N, cld (N, np)), T, size (input))
126+ C = zeros (Blocks (cld (N, np), cld (N, np), N), T, size (input))
127127 copyto! (A, input)
128128 __fft! (decomp, A, B, C, dims)
129129 copyto! (output, C)
130130 return output
131131 elseif decomp isa Slab
132- A = zeros (Blocks (N, N, div (N, np)), T, size (input))
133- B = zeros (Blocks (div (N, np), div (N, np), N), T, size (input))
132+ A = zeros (Blocks (N, N, cld (N, np)), T, size (input))
133+ B = zeros (Blocks (cld (N, np), cld (N, np), N), T, size (input))
134134 copyto! (A, input)
135135 __fft! (decomp, A, B, dims)
136136 copyto! (output, B)
@@ -143,16 +143,16 @@ function _ifft!(output::DArray{T,3}, input::DArray{T,3}, dims=(1, 2, 3); decomp:
143143 N = size (input, 1 )
144144 np = length (Dagger. compatible_processors ())
145145 if decomp isa Pencil
146- A = zeros (Blocks (div (N, np), div (N, np), N), T, size (input))
147- B = zeros (Blocks (div (N, np), N, div (N, np)), T, size (input))
148- C = zeros (Blocks (N, div (N, np), div (N, np)), T, size (input))
146+ A = zeros (Blocks (cld (N, np), cld (N, np), N), T, size (input))
147+ B = zeros (Blocks (cld (N, np), N, cld (N, np)), T, size (input))
148+ C = zeros (Blocks (N, cld (N, np), cld (N, np)), T, size (input))
149149 copyto! (A, input)
150150 __ifft! (decomp, A, B, C, dims)
151151 copyto! (output, C)
152152 return output
153153 elseif decomp isa Slab
154- A = zeros (Blocks (div (N, np), div (N, np), N), T, size (input))
155- B = zeros (Blocks (N, N, div (N, np)), T, size (input))
154+ A = zeros (Blocks (cld (N, np), cld (N, np), N), T, size (input))
155+ B = zeros (Blocks (N, N, cld (N, np)), T, size (input))
156156 copyto! (A, input)
157157 __ifft! (decomp, A, B, dims)
158158 copyto! (output, B)
0 commit comments