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

Method calcFlops

src/statTimer/statisticalTimer.GPU.h:84–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82 }
83
84 double calcFlops( )
85 {
86 size_t fftLength = 0;
87 size_t dimIndex = 0;
88
89 if( dim == CLFFT_1D )
90 {
91 fftLength = lengths.at( 0 );
92 dimIndex = 1;
93 }
94 else if( dim == CLFFT_2D )
95 {
96 fftLength = lengths.at( 0 ) * lengths.at( 1 );
97 dimIndex = 2;
98 }
99 else if( dim == CLFFT_3D )
100 {
101 fftLength = lengths.at( 0 ) * lengths.at( 1 ) * lengths.at( 2 );
102 dimIndex = 3;
103 }
104
105 size_t cumulativeBatch = 1;
106 for( ; dimIndex < lengths.size(); ++dimIndex )
107 {
108 cumulativeBatch *= std::max< size_t >( 1, lengths[ dimIndex ] );
109 }
110 cumulativeBatch *= batchSize;
111
112 double flops = cumulativeBatch * 5 * fftLength * ( log( static_cast< double >( fftLength ) ) / log( 2.0 ) );
113
114 return flops;
115 }
116
117};
118

Callers 1

PrintMethod · 0.80

Calls 2

logFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected