Commit 3026c0b4 authored by Tobias Winchen's avatar Tobias Winchen
Browse files

Fix detector accumulator test and 8-bit mode

parent e3edc797
......@@ -30,7 +30,7 @@ void detect_and_accumulate(float2 const* __restrict__ in, int8_t* __restrict__ o
double y = tmp.y * tmp.y;
sum += x + y;
}
size_t toff = out_offset * nchans + currentOutputSpectra * nchans;
size_t toff = out_offset * nchans + currentOutputSpectra * nchans *stride;
out[toff + i] = (int8_t) ((sum - offset)/scale);
}
......
......@@ -90,10 +90,12 @@ TEST_F(DetectorAccumulatorTester, noise_test)
}
DetectorAccumulator<int8_t>::InputType gpu_input = host_input;
DetectorAccumulator<int8_t>::OutputType gpu_output;
gpu_output.resize(gpu_input.size() / tscrunch );
OutputType host_output;
DetectorAccumulator<int8_t> detector(nchans, tscrunch, scale, 0.0, _stream);
detector.detect(gpu_input, gpu_output);
detect_c_reference(host_input, host_output, nchans, tscrunch, scale, 0.0);
CUDA_ERROR_CHECK(cudaStreamSynchronize(_stream));
compare_against_host(gpu_output, host_output);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment