98
98
function _fft! (output:: DMatrix{T} , input:: DMatrix{T} , dims= (1 , 2 )) where T
99
99
N = size (input, 1 )
100
100
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))
102
102
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))
104
104
__fft! (A, B, dims)
105
105
copyto! (output, B)
106
106
return output
107
107
end
108
108
function _ifft! (output:: DMatrix{T} , input:: DMatrix{T} , dims= (1 , 2 )) where T
109
109
N = size (input, 1 )
110
110
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))
112
112
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))
114
114
__ifft! (A, B, dims)
115
115
copyto! (output, B)
116
116
return output
@@ -121,16 +121,16 @@ function _fft!(output::DArray{T,3}, input::DArray{T,3}, dims=(1, 2, 3); decomp::
121
121
N = size (input, 1 )
122
122
np = length (Dagger. compatible_processors ())
123
123
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))
127
127
copyto! (A, input)
128
128
__fft! (decomp, A, B, C, dims)
129
129
copyto! (output, C)
130
130
return output
131
131
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))
134
134
copyto! (A, input)
135
135
__fft! (decomp, A, B, dims)
136
136
copyto! (output, B)
@@ -143,16 +143,16 @@ function _ifft!(output::DArray{T,3}, input::DArray{T,3}, dims=(1, 2, 3); decomp:
143
143
N = size (input, 1 )
144
144
np = length (Dagger. compatible_processors ())
145
145
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))
149
149
copyto! (A, input)
150
150
__ifft! (decomp, A, B, C, dims)
151
151
copyto! (output, C)
152
152
return output
153
153
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))
156
156
copyto! (A, input)
157
157
__ifft! (decomp, A, B, dims)
158
158
copyto! (output, B)
0 commit comments