Slide 86
Slide 86 text
__device__ void output_comp_cb(!
void *dataOut, size_t offset, cufftComplex element,!
void *callerInfo, void *sharedPtr!
) {!
fft_detail *detail = (fft_detail*)callerInfo;!
const size_t index =!
offset % ( (detail->resolution/2) + 1 );!
const size_t batch =!
detail->batch_offset + offset /!
( (detail->resolution/2) + 1 );!
if( index < detail->width ) {!
if( batch < detail->reference_batch_count ) {!
const float value = cuCabsf( element );!
atomicAdd( detail->envelope + batch, value );!
const float log_value_ =!
80.f * __log10f( value < 1.f ? 1.f : value );!
const int log_value =!
log_value_ > 255.f ?!
int( 255 ) : int( log_value_ );!
atomicAdd( &detail->diff, float( __sad(!
log_value,!
int( detail->reference[ index + detail->width * batch ] ),!
0!
) ) );!
}!
else {!
''5ޙͷग़ྗʹίʔϧόοΫΛઃఆ