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

Method OffsetCalcBlock

src/library/generator.stockham.cpp:2868–2898  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2866 }
2867
2868 inline std::string OffsetCalcBlock(const std::string &off, bool input = true)
2869 {
2870 std::string str;
2871
2872 const size_t *pStride = input ? params.fft_inStride : params.fft_outStride;
2873
2874 str += "\t"; str += off; str += " = ";
2875 std::string nextBatch = "batch";
2876 for(size_t i=(params.fft_DataDim - 1); i>2; i--)
2877 {
2878 size_t currentLength = 1;
2879 for(int j=2; j<i; j++) currentLength *= params.fft_N[j];
2880 currentLength *= (params.fft_N[1]/blockWidth);
2881
2882 str += "("; str += nextBatch; str += "/"; str += SztToStr(currentLength);
2883 str += ")*"; str += SztToStr(pStride[i]); str += " + ";
2884
2885 nextBatch = "(" + nextBatch + "%" + SztToStr(currentLength) + ")";
2886 }
2887
2888 str += "("; str += nextBatch; str += "/"; str += SztToStr(params.fft_N[1]/blockWidth);
2889 str += ")*"; str += SztToStr(pStride[2]); str += " + ("; str += nextBatch;
2890 str += "%"; str += SztToStr(params.fft_N[1]/blockWidth); str += ")*";
2891 if( (input && (blockComputeType == BCT_R2C)) || (!input && (blockComputeType == BCT_C2R)) )
2892 str += SztToStr(blockWidth*length);
2893 else
2894 str += SztToStr(blockWidth);
2895 str += ";\n";
2896
2897 return str;
2898 }
2899
2900 inline std::string OffsetCalc(const std::string &off, bool input = true, bool rc_second_index = false)
2901 {

Callers

nothing calls this directly

Calls 1

SztToStrFunction · 0.85

Tested by

no test coverage detected