Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
psrdada_cpp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Winchen
psrdada_cpp
Commits
6118c967
Commit
6118c967
authored
4 years ago
by
Tobias Winchen
Browse files
Options
Downloads
Patches
Plain Diff
Removed unnecessary variables
parent
5746500b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
psrdada_cpp/effelsberg/edd/SKRfiReplacementCuda.cuh
+0
-5
0 additions, 5 deletions
psrdada_cpp/effelsberg/edd/SKRfiReplacementCuda.cuh
psrdada_cpp/effelsberg/edd/src/SKRfiReplacementCuda.cu
+24
-31
24 additions, 31 deletions
psrdada_cpp/effelsberg/edd/src/SKRfiReplacementCuda.cu
with
24 additions
and
36 deletions
psrdada_cpp/effelsberg/edd/SKRfiReplacementCuda.cuh
+
0
−
5
View file @
6118c967
...
@@ -43,14 +43,9 @@ public:
...
@@ -43,14 +43,9 @@ public:
private:
private:
thrust
::
device_vector
<
int
>
_rfi_status
;
std
::
size_t
_window_size
;
std
::
size_t
_nwindows
,
_nrfi_windows
,
_nclean_windows
;
std
::
size_t
_nclean_windows_stat
;
//number of clean windows used for computing DataStatistics
thrust
::
device_vector
<
int
>
_rfi_window_indices
;
thrust
::
device_vector
<
int
>
_rfi_window_indices
;
thrust
::
device_vector
<
int
>
_clean_window_indices
;
thrust
::
device_vector
<
int
>
_clean_window_indices
;
thrust
::
device_vector
<
thrust
::
complex
<
float
>>
_clean_data
;
thrust
::
device_vector
<
thrust
::
complex
<
float
>>
_clean_data
;
float
_ref_mean
,
_ref_sd
;
};
};
}
//edd
}
//edd
}
//effelsberg
}
//effelsberg
...
...
This diff is collapsed.
Click to expand it.
psrdada_cpp/effelsberg/edd/src/SKRfiReplacementCuda.cu
+
24
−
31
View file @
6118c967
...
@@ -31,12 +31,12 @@ struct generate_replacement_data{
...
@@ -31,12 +31,12 @@ struct generate_replacement_data{
SKRfiReplacementCuda
::
SKRfiReplacementCuda
()
SKRfiReplacementCuda
::
SKRfiReplacementCuda
()
{
{
BOOST_LOG_TRIVIAL
(
info
)
<<
"Creating new SKRfiReplacementCuda instance..
\n
"
;
BOOST_LOG_TRIVIAL
(
debug
)
<<
"Creating new SKRfiReplacementCuda instance..
\n
"
;
}
}
SKRfiReplacementCuda
::~
SKRfiReplacementCuda
()
SKRfiReplacementCuda
::~
SKRfiReplacementCuda
()
{
{
BOOST_LOG_TRIVIAL
(
info
)
<<
"Destroying SKRfiReplacementCuda instance..
\n
"
;
BOOST_LOG_TRIVIAL
(
debug
)
<<
"Destroying SKRfiReplacementCuda instance..
\n
"
;
}
}
...
@@ -45,40 +45,37 @@ void SKRfiReplacementCuda::replace_rfi_data(const thrust::device_vector<int> &rf
...
@@ -45,40 +45,37 @@ void SKRfiReplacementCuda::replace_rfi_data(const thrust::device_vector<int> &rf
std
::
size_t
clean_windows
)
std
::
size_t
clean_windows
)
{
{
nvtxRangePushA
(
"replace_rfi_data"
);
nvtxRangePushA
(
"replace_rfi_data"
);
_rfi_status
=
rfi_status
;
thrust
::
device_vector
<
thrust
::
complex
<
float
>>
replacement_data
;
thrust
::
device_vector
<
thrust
::
complex
<
float
>>
replacement_data
;
//initialize data members of the class
//initialize data members of the class
_nclean_windows_stat
=
clean_windows
;
//no. of clean windows used for computing statistics
BOOST_LOG_TRIVIAL
(
info
)
<<
"initializing the states of SKRfiReplacementCuda"
<<
" class members for the data to be processed..
\n
"
;
_nwindows
=
_rfi_status
.
size
();
//get_rfi_window_indices();
BOOST_LOG_TRIVIAL
(
debug
)
<<
"getting RFI window indices..
\n
"
;
BOOST_LOG_TRIVIAL
(
debug
)
<<
"getting RFI window indices..
\n
"
;
_
n
rfi_window
s
=
thrust
::
count
(
_
rfi_status
.
begin
(),
_
rfi_status
.
end
(),
1
);
_rfi_window
_indices
.
resize
(
thrust
::
count
(
rfi_status
.
begin
(),
rfi_status
.
end
(),
1
)
)
;
_rfi_window_indices
.
resize
(
_nrfi_windows
);
thrust
::
copy_if
(
thrust
::
make_counting_iterator
<
int
>
(
0
),
thrust
::
copy_if
(
thrust
::
make_counting_iterator
<
int
>
(
0
),
thrust
::
make_counting_iterator
<
int
>
(
_nwindows
),
thrust
::
make_counting_iterator
<
int
>
(
rfi_status
.
size
()
),
_
rfi_status
.
begin
(),
rfi_status
.
begin
(),
_rfi_window_indices
.
begin
(),
_rfi_window_indices
.
begin
(),
thrust
::
placeholders
::
_1
==
1
);
thrust
::
placeholders
::
_1
==
1
);
//get_clean_window_indices();
BOOST_LOG_TRIVIAL
(
debug
)
<<
"getting clean window indices..
\n
"
;
BOOST_LOG_TRIVIAL
(
debug
)
<<
"getting clean window indices..
\n
"
;
_nclean_windows
=
thrust
::
count
(
_
rfi_status
.
begin
(),
_
rfi_status
.
end
(),
0
);
size_t
_nclean_windows
=
thrust
::
count
(
rfi_status
.
begin
(),
rfi_status
.
end
(),
0
);
_clean_window_indices
.
resize
(
_nclean_windows
);
_clean_window_indices
.
resize
(
_nclean_windows
);
thrust
::
copy_if
(
thrust
::
make_counting_iterator
<
int
>
(
0
),
thrust
::
copy_if
(
thrust
::
make_counting_iterator
<
int
>
(
0
),
thrust
::
make_counting_iterator
<
int
>
(
_nwindows
),
thrust
::
make_counting_iterator
<
int
>
(
rfi_status
.
size
()
),
_
rfi_status
.
begin
(),
rfi_status
.
begin
(),
_clean_window_indices
.
begin
(),
_clean_window_indices
.
begin
(),
thrust
::
placeholders
::
_1
==
0
);
thrust
::
placeholders
::
_1
==
0
);
if
(
_nclean_windows
<
_nwindows
){
//if RFI is present
if
(
_nclean_windows
<
rfi_status
.
size
()){
//Getting clean data statistics of chosen number of clean windows
//RFI present and not in all windows
if
(
_nclean_windows
<
_nclean_windows_stat
)
_nclean_windows_stat
=
_nclean_windows
;
if
(
_nclean_windows
<
clean_windows
)
{
clean_windows
=
_nclean_windows
;
}
BOOST_LOG_TRIVIAL
(
debug
)
<<
"collecting clean data from chosen number of clean windows..
\n
"
;
BOOST_LOG_TRIVIAL
(
debug
)
<<
"collecting clean data from chosen number of clean windows..
\n
"
;
_window_size
=
data
.
size
()
/
_nwindows
;
std
::
size_t
_window_size
=
data
.
size
()
/
rfi_status
.
size
()
;
_clean_data
.
resize
(
_n
clean_windows
_stat
*
_window_size
);
_clean_data
.
resize
(
clean_windows
*
_window_size
);
for
(
std
::
size_t
ii
=
0
;
ii
<
_n
clean_windows
_stat
;
ii
++
){
for
(
std
::
size_t
ii
=
0
;
ii
<
clean_windows
;
ii
++
){
std
::
size_t
window_index
=
_clean_window_indices
[
ii
];
std
::
size_t
window_index
=
_clean_window_indices
[
ii
];
std
::
size_t
ibegin
=
window_index
*
_window_size
;
std
::
size_t
ibegin
=
window_index
*
_window_size
;
std
::
size_t
iend
=
ibegin
+
_window_size
-
1
;
std
::
size_t
iend
=
ibegin
+
_window_size
-
1
;
...
@@ -87,24 +84,20 @@ void SKRfiReplacementCuda::replace_rfi_data(const thrust::device_vector<int> &rf
...
@@ -87,24 +84,20 @@ void SKRfiReplacementCuda::replace_rfi_data(const thrust::device_vector<int> &rf
BOOST_LOG_TRIVIAL
(
debug
)
<<
"clean_win_index = "
<<
window_index
BOOST_LOG_TRIVIAL
(
debug
)
<<
"clean_win_index = "
<<
window_index
<<
" ibegin = "
<<
ibegin
<<
" iend = "
<<
iend
;
<<
" ibegin = "
<<
ibegin
<<
" iend = "
<<
iend
;
}
}
//computing clean data statistics
BOOST_LOG_TRIVIAL
(
debug
)
<<
"computing statistics of clean data..
\n
"
;
BOOST_LOG_TRIVIAL
(
debug
)
<<
"computing statistics of clean data..
\n
"
;
//The distribution of both real and imag
h
ave same mean and standard deviation.
//The distribution of both real and imag a
re expected to ah
ve
same mean and standard deviation.
//Therefore computing _ref_mean, _ref_sd for real distribution only.
//Therefore computing _ref_mean, _ref_sd for real distribution only.
std
::
size_t
length
=
_clean_data
.
size
();
std
::
size_t
length
=
_clean_data
.
size
();
_ref_mean
=
(
thrust
::
reduce
(
_clean_data
.
begin
(),
_clean_data
.
end
(),
thrust
::
complex
<
float
>
(
0.0
f
,
0.0
f
))).
real
()
/
length
;
float
_ref_mean
=
(
thrust
::
reduce
(
_clean_data
.
begin
(),
_clean_data
.
end
(),
thrust
::
complex
<
float
>
(
0.0
f
,
0.0
f
))).
real
()
/
length
;
_ref_sd
=
std
::
sqrt
(
thrust
::
transform_reduce
(
_clean_data
.
begin
(),
_clean_data
.
end
(),
mean_subtraction_square
(
_ref_mean
),
float
_ref_sd
=
std
::
sqrt
(
thrust
::
transform_reduce
(
_clean_data
.
begin
(),
_clean_data
.
end
(),
mean_subtraction_square
(
_ref_mean
),
0.0
f
,
thrust
::
plus
<
float
>
())
/
length
);
0.0
f
,
thrust
::
plus
<
float
>
())
/
length
);
BOOST_LOG_TRIVIAL
(
debug
)
<<
"DataStatistics mean = "
<<
_ref_mean
BOOST_LOG_TRIVIAL
(
debug
)
<<
"DataStatistics mean = "
<<
_ref_mean
<<
" sd = "
<<
_ref_sd
;
<<
" sd = "
<<
_ref_sd
;
}
//RFI present and not in all windows
if
(
_nclean_windows
<
_nwindows
){
//Replacing RFI
//Replacing RFI
thrust
::
counting_iterator
<
unsigned
int
>
sequence_index_begin
(
0
);
thrust
::
counting_iterator
<
unsigned
int
>
sequence_index_begin
(
0
);
nvtxRangePushA
(
"replace_rfi_datai_loop"
);
nvtxRangePushA
(
"replace_rfi_datai_loop"
);
for
(
std
::
size_t
ii
=
0
;
ii
<
_
n
rfi_window
s
;
ii
++
){
for
(
std
::
size_t
ii
=
0
;
ii
<
_rfi_window
_indices
.
size
()
;
ii
++
){
std
::
size_t
index
=
_rfi_window_indices
[
ii
]
*
_window_size
;
std
::
size_t
index
=
_rfi_window_indices
[
ii
]
*
_window_size
;
thrust
::
transform
(
sequence_index_begin
,
(
sequence_index_begin
+
_window_size
),
thrust
::
transform
(
sequence_index_begin
,
(
sequence_index_begin
+
_window_size
),
(
data
.
begin
()
+
index
),
generate_replacement_data
(
_ref_mean
,
_ref_sd
));
(
data
.
begin
()
+
index
),
generate_replacement_data
(
_ref_mean
,
_ref_sd
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment