Skip to content

Commit 0e6e31a

Browse files
committed
Change fft bitReverse name, update examples pointer submodule
1 parent 47f018a commit 0e6e31a

File tree

3 files changed

+6
-25
lines changed

3 files changed

+6
-25
lines changed

include/nbl/builtin/hlsl/fft/common.hlsl

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
#include <nbl/builtin/hlsl/complex.hlsl>
66
#include <nbl/builtin/hlsl/concepts.hlsl>
77
#include <nbl/builtin/hlsl/math/intutil.hlsl>
8-
#include "nbl/builtin/hlsl/numbers.hlsl"
9-
#include "nbl/builtin/hlsl/concepts.hlsl"
8+
#include <nbl/builtin/hlsl/numbers.hlsl>
109

1110
namespace nbl
1211
{
@@ -96,33 +95,15 @@ void unpack(NBL_REF_ARG(complex_t<Scalar>) lo, NBL_REF_ARG(complex_t<Scalar>) hi
9695
lo = x;
9796
}
9897

99-
100-
}
101-
}
102-
}
103-
104-
#ifdef __HLSL_VERSION
105-
106-
namespace nbl
107-
{
108-
namespace hlsl
109-
{
110-
namespace fft
111-
{
112-
113-
// ------------------------------------------------- Utils ---------------------------------------------------------
114-
11598
// Bit-reverses T as a binary string of length given by Bits
11699
template<typename T, uint16_t Bits NBL_FUNC_REQUIRES(is_integral_v<T> && Bits <= sizeof(T) * 8)
117-
T bitReverse(T value)
100+
T bitReverseAs(T value)
118101
{
119-
return spirv::bitReverse<uint32_t>(value) >> (sizeof(T) * 8 - Bits);
102+
return hlsl::bitReverse<uint32_t>(value) >> (sizeof(T) * 8 - Bits);
120103
}
121104

122105
}
123106
}
124107
}
125108

126-
#endif
127-
128109
#endif

include/nbl/builtin/hlsl/workgroup/fft.hlsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,14 @@ struct FFTIndexingUtils
163163
// This is because Cooley-Tukey + subgroup operations end up spewing out the outputs in a weird order
164164
static uint32_t getDFTIndex(uint32_t outputIdx)
165165
{
166-
return impl::circularBitShiftRightHigher<FFTSizeLog2, FFTSizeLog2 - ElementsPerInvocationLog2 + 1>(hlsl::fft::bitReverse<uint32_t, FFTSizeLog2>(outputIdx));
166+
return impl::circularBitShiftRightHigher<FFTSizeLog2, FFTSizeLog2 - ElementsPerInvocationLog2 + 1>(hlsl::fft::bitReverseAs<uint32_t, FFTSizeLog2>(outputIdx));
167167
}
168168

169169
// This function maps the index `freqIdx` in the DFT to the index `idx` in the output array of a Nabla FFT such that `DFT[freqIdx] = NablaFFT[idx]`
170170
// It is essentially the inverse of `getDFTIndex`
171171
static uint32_t getNablaIndex(uint32_t freqIdx)
172172
{
173-
return hlsl::fft::bitReverse<uint32_t, FFTSizeLog2>(impl::circularBitShiftLeftHigher<FFTSizeLog2, FFTSizeLog2 - ElementsPerInvocationLog2 + 1>(freqIdx));
173+
return hlsl::fft::bitReverseAs<uint32_t, FFTSizeLog2>(impl::circularBitShiftLeftHigher<FFTSizeLog2, FFTSizeLog2 - ElementsPerInvocationLog2 + 1>(freqIdx));
174174
}
175175

176176
// Mirrors an index about the Nyquist frequency in the DFT order

0 commit comments

Comments
 (0)