MCPcopy Create free account
hub / github.com/clMathLibraries/clFFT / Swap_OffsetCalc

Function Swap_OffsetCalc

src/library/generator.transpose.cpp:66–80  ·  view source on GitHub ↗

generating string for calculating offset within swap kernels (genSwapKernel)

Source from the content-addressed store, hash-verified

64
65// generating string for calculating offset within swap kernels (genSwapKernel)
66void Swap_OffsetCalc(std::stringstream& transKernel, const FFTKernelGenKeyParams& params)
67{
68 const size_t *stride = params.fft_inStride;
69 std::string offset = "iOffset";
70
71 clKernWrite(transKernel, 3) << "size_t " << offset << " = 0;" << std::endl;
72
73 for (size_t i = params.fft_DataDim - 2; i > 0; i--)
74 {
75 clKernWrite(transKernel, 3) << offset << " += (g_index/numGroupsY_" << i << ")*" << stride[i + 1] << ";" << std::endl;
76 clKernWrite(transKernel, 3) << "g_index = g_index % numGroupsY_" << i << ";" << std::endl;
77 }
78
79 clKernWrite(transKernel, 3) << std::endl;
80}
81
82// Small snippet of code that multiplies the twiddle factors into the butterfiles. It is only emitted if the plan tells
83// the generator that it wants the twiddle factors generated inside of the transpose

Callers 1

genSwapKernelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected