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
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
MPIfR-BDG
psrdada_cpp
Commits
5263ab59
Commit
5263ab59
authored
3 years ago
by
Tobias Winchen
Browse files
Options
Downloads
Patches
Plain Diff
Added test for detect accumualte float output
parent
c673c39a
No related branches found
No related tags found
1 merge request
!14
Detect accumulate fix
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
psrdada_cpp/effelsberg/edd/test/src/DetectorAccumulatorTester.cu
+67
-0
67 additions, 0 deletions
..._cpp/effelsberg/edd/test/src/DetectorAccumulatorTester.cu
psrdada_cpp/effelsberg/edd/test/src/GatedSpectrometerTest.cu
+1
-0
1 addition, 0 deletions
psrdada_cpp/effelsberg/edd/test/src/GatedSpectrometerTest.cu
with
68 additions
and
0 deletions
psrdada_cpp/effelsberg/edd/test/src/DetectorAccumulatorTester.cu
+
67
−
0
View file @
5263ab59
...
...
@@ -99,6 +99,73 @@ TEST_F(DetectorAccumulatorTester, noise_test)
compare_against_host
(
gpu_output
,
host_output
);
}
// parameters for the detector accumulator test
struct
detect_accumulate_params
{
size_t
nchan
;
// umber of channels
size_t
nspectra
;
// number of output spectra
size_t
naccumulate
;
// number of spectra to accumulate
};
class
detect_and_accumulate32bit
:
public
testing
::
TestWithParam
<
detect_accumulate_params
>
{
// Test that the kernel executes in certain parameter
// settings
};
TEST_P
(
detect_and_accumulate32bit
,
no_stride
)
{
thrust
::
device_vector
<
float2
>
input
;
thrust
::
device_vector
<
float
>
output
;
detect_accumulate_params
params
=
GetParam
();
input
.
resize
(
params
.
nspectra
*
params
.
nchan
*
params
.
naccumulate
);
output
.
resize
(
params
.
nspectra
*
params
.
nchan
);
float2
v
;
v
.
x
=
1.0
;
v
.
y
=
1.0
;
thrust
::
fill
(
input
.
begin
(),
input
.
end
(),
v
);
thrust
::
fill
(
output
.
begin
(),
output
.
end
(),
0.
);
kernels
::
detect_and_accumulate
<
float
>
<<<
1024
,
1024
>>>
(
thrust
::
raw_pointer_cast
(
input
.
data
()),
thrust
::
raw_pointer_cast
(
output
.
data
()),
params
.
nchan
,
input
.
size
(),
params
.
naccumulate
,
1
,
0.
,
1
,
0
);
cudaDeviceSynchronize
();
thrust
::
host_vector
<
float
>
output_host
=
output
;
for
(
size_t
i
=
0
;
i
<
output
.
size
();
i
++
)
{
ASSERT_FLOAT_EQ
(
output_host
[
i
],
(
v
.
x
*
v
.
x
+
v
.
y
*
v
.
y
)
*
params
.
naccumulate
)
<<
"i = "
<<
i
<<
" for nchan = "
<<
params
.
nchan
<<
", nspectra = "
<<
params
.
nspectra
<<
", naccumulate = "
<<
params
.
naccumulate
;
}
}
INSTANTIATE_TEST_CASE_P
(
DetectorAccumulatorTester
,
detect_and_accumulate32bit
,
testing
::
Values
(
// nchan; nspectra; naccumulate;
detect_accumulate_params
({
1024
,
1
,
128
}),
detect_accumulate_params
({
1024
,
1
,
1024
}),
detect_accumulate_params
({
1024
,
1
,
2048
}),
detect_accumulate_params
({
1024
,
1
,
16384
}),
detect_accumulate_params
({
1024
,
16
,
1024
}),
detect_accumulate_params
({
8388608
,
2
,
16
}),
detect_accumulate_params
({
8388608
,
1
,
32
})
)
);
}
//namespace test
}
//namespace edd
}
//namespace meerkat
...
...
This diff is collapsed.
Click to expand it.
psrdada_cpp/effelsberg/edd/test/src/GatedSpectrometerTest.cu
+
1
−
0
View file @
5263ab59
...
...
@@ -146,6 +146,7 @@ TEST(GatedSpectrometer, stokes_accumulate)
testStokesAccumulateParam
(
8
*
1024
*
1024
+
1
,
32
);
testStokesAccumulateParam
(
1024
+
1
,
5
);
testStokesAccumulateParam
(
1024
+
1
,
64
);
testStokesAccumulateParam
(
1024
,
65536
);
}
...
...
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