Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/fft/fft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,7 @@ namespace {

// Compute a factorization of N suitable for use in the FFT.
vector<int> radix_factor(int N) {
assert(N > 0);
// Some special cases to optimize.
switch (N) {
case 16:
Expand Down
10 changes: 4 additions & 6 deletions apps/fft/fft_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,9 @@ class FFTGenerator : public Halide::Generator<FFTGenerator> {
GeneratorParam<FFTNumberType> output_number_type{"output_number_type",
FFTNumberType::Real, fft_number_type_enum_map()};

// Size of first dimension, required to be greater than zero.
GeneratorParam<int32_t> size0{"size0", 1};
// Size of second dimension, may be zero for 1D FFT.
GeneratorParam<int32_t> size1{"size1", 0};
// TODO(zalman): Add support for 3D and maybe 4D FFTs
// Size of dimensions, required to be greater than one
GeneratorParam<int32_t> size0{"size0", 2};
GeneratorParam<int32_t> size1{"size1", 2};

// The input buffer. Must be separate from the output.
// Only Float(32) is supported.
Expand All @@ -85,7 +83,7 @@ class FFTGenerator : public Halide::Generator<FFTGenerator> {
Output<Buffer<float, 3>> output{"output"};

void generate() {
_halide_user_assert(size0 > 0) << "FFT must be at least 1D\n";
_halide_user_assert(size0 > 1 && size1 > 1) << "Both dimensions must be at least size 2\n";

Fft2dDesc desc;

Expand Down
Loading