Commit feeb7ebb authored by sakthipriyas's avatar sakthipriyas
Browse files

included resetting of device variable

parent 2cac5f79
......@@ -171,6 +171,8 @@ void SpectralKurtosisCuda::compute_sk_k(thrust::device_vector<thrust::complex<fl
int nrfiwindows = 0;
cudaMemcpyFromSymbol(&nrfiwindows, rfi_count, sizeof(int));
stats.rfi_fraction = (float)nrfiwindows / _nwindows;
int reset_rfi_count = 0;
cudaMemcpyToSymbol(rfi_count, &reset_rfi_count, sizeof(int));
nvtxRangePop();
BOOST_LOG_TRIVIAL(info) << "RFI fraction: " << stats.rfi_fraction;
nvtxRangePop();
......
......@@ -18,6 +18,6 @@ set(
src/SpectralKurtosisCudaTester.cu
)
cuda_add_executable(gtest_edd ${gtest_edd_src} )
target_link_libraries(gtest_edd ${PSRDADA_CPP_EFFELSBERG_EDD_LIBRARIES} ${CUDA_CUFFT_LIBRARIES} -lcublas -lnvToolsExt -L/usr/local/cuda-10.1/lib64/)
target_link_libraries(gtest_edd ${PSRDADA_CPP_EFFELSBERG_EDD_LIBRARIES} ${CUDA_CUFFT_LIBRARIES} -lcublas -lnvToolsExt -L/usr/local/cuda-11.0/lib64/)
add_test(gtest_edd gtest_edd --test_data "${CMAKE_CURRENT_LIST_DIR}/data")
......@@ -136,6 +136,17 @@ TEST_F(SpectralKurtosisCudaTester, sk_kernel)
EXPECT_EQ(stat.rfi_status[ii], stat_k.rfi_status[ii]);
}
EXPECT_EQ(stat.rfi_fraction, stat_k.rfi_fraction);
//RFI replacement
BOOST_LOG_TRIVIAL(info) <<"RFI replacement..\n";
SKRfiReplacementCuda rr;
rr.replace_rfi_data(stat_k.rfi_status, d_samples);
//SK computation after RFI replacement
BOOST_LOG_TRIVIAL(info) <<"computing SK after replacing the RFI data..\n";
sk.compute_sk_k(d_samples, stat_k);
float expected_val_after_rfi_replacement = 0;
EXPECT_EQ(expected_val_after_rfi_replacement, stat_k.rfi_fraction);
}
} //test
......
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