Skip to content

Commit f859108

Browse files
authored
Subgroup strided FFTs (#142)
* Subgroup strided FFTs * tidying * add more variety to the sizes chosen for testing * update log line * remove unneeded +1 * moved private memory definition to make AMD happy * comment * use initialised private array * format * add comment to explain AMD hack
1 parent 330f37b commit f859108

File tree

4 files changed

+211
-94
lines changed

4 files changed

+211
-94
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ portFFT is still in early development. The supported configurations are:
9696
* size in each dimension must be supported by 1D transforms
9797
* Arbitrary forward and backward scales
9898
* Arbitrary forward and backward offsets
99-
* Arbitrary strides and distance where the problem size + auxilary data fits in the registers of a single work-item.
99+
* Arbitrary strides and distance where the problem size + auxilary data fits in the registers of a single subgroup.
100100

101101
Any 1D arbitrarily large input size that fits in global memory is supported, with a restriction that large input sizes should not have large prime factors.
102102
The largest prime factor depend on the device and the values set by `PORTFFT_REGISTERS_PER_WI` and `PORTFFT_SUBGROUP_SIZES`.

src/portfft/descriptor_validation.hpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include <string_view>
2525

2626
#include "common/exceptions.hpp"
27-
#include "common/workitem.hpp"
27+
#include "common/subgroup.hpp"
2828
#include "enums.hpp"
2929
#include "utils.hpp"
3030

@@ -65,10 +65,17 @@ inline void validate_layout(const std::vector<std::size_t>& lengths, portfft::de
6565
}
6666
}
6767
if (forward_layout == portfft::detail::layout::UNPACKED || backward_layout == portfft::detail::layout::UNPACKED) {
68-
if (!portfft::detail::fits_in_wi<Scalar>(lengths.back())) {
68+
bool fits_subgroup = false;
69+
for (auto sg_size : {PORTFFT_SUBGROUP_SIZES}) {
70+
fits_subgroup =
71+
fits_subgroup || portfft::detail::fits_in_sg<Scalar>(static_cast<IdxGlobal>(lengths.back()), sg_size);
72+
if (fits_subgroup) {
73+
break;
74+
}
75+
}
76+
if (!fits_subgroup) {
6977
throw unsupported_configuration(
70-
"Arbitrary strides and distances are only supported for sizes that fit in the registers of a single "
71-
"work-item");
78+
"Arbitrary strides and distances are only supported for sizes that fit in the registers of a subgroup");
7279
}
7380
}
7481
}

0 commit comments

Comments
 (0)