Skip to content
Snippets Groups Projects
Commit 3026c0b4 authored by Tobias Winchen's avatar Tobias Winchen
Browse files

Fix detector accumulator test and 8-bit mode

parent e3edc797
No related branches found
No related tags found
No related merge requests found
...@@ -30,7 +30,7 @@ void detect_and_accumulate(float2 const* __restrict__ in, int8_t* __restrict__ o ...@@ -30,7 +30,7 @@ void detect_and_accumulate(float2 const* __restrict__ in, int8_t* __restrict__ o
double y = tmp.y * tmp.y; double y = tmp.y * tmp.y;
sum += x + 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); out[toff + i] = (int8_t) ((sum - offset)/scale);
} }
......
...@@ -90,10 +90,12 @@ TEST_F(DetectorAccumulatorTester, noise_test) ...@@ -90,10 +90,12 @@ TEST_F(DetectorAccumulatorTester, noise_test)
} }
DetectorAccumulator<int8_t>::InputType gpu_input = host_input; DetectorAccumulator<int8_t>::InputType gpu_input = host_input;
DetectorAccumulator<int8_t>::OutputType gpu_output; DetectorAccumulator<int8_t>::OutputType gpu_output;
gpu_output.resize(gpu_input.size() / tscrunch );
OutputType host_output; OutputType host_output;
DetectorAccumulator<int8_t> detector(nchans, tscrunch, scale, 0.0, _stream); DetectorAccumulator<int8_t> detector(nchans, tscrunch, scale, 0.0, _stream);
detector.detect(gpu_input, gpu_output); detector.detect(gpu_input, gpu_output);
detect_c_reference(host_input, host_output, nchans, tscrunch, scale, 0.0); detect_c_reference(host_input, host_output, nchans, tscrunch, scale, 0.0);
CUDA_ERROR_CHECK(cudaStreamSynchronize(_stream));
compare_against_host(gpu_output, host_output); compare_against_host(gpu_output, host_output);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment