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
abe644a5
Commit
abe644a5
authored
6 years ago
by
Tobias Winchen
Browse files
Options
Downloads
Patches
Plain Diff
Fixed indentation
parent
c3ca509c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
psrdada_cpp/effelsberg/edd/src/GatedSpectrometer_cli.cu
+21
-35
21 additions, 35 deletions
psrdada_cpp/effelsberg/edd/src/GatedSpectrometer_cli.cu
with
21 additions
and
35 deletions
psrdada_cpp/effelsberg/edd/src/GatedSpectrometer_cli.cu
+
21
−
35
View file @
abe644a5
...
@@ -30,16 +30,11 @@ void launchSpectrometer(std::string const &output_type, key_t input_key, std::st
...
@@ -30,16 +30,11 @@ void launchSpectrometer(std::string const &output_type, key_t input_key, std::st
{
{
MultiLog
log
(
"edd::GatedSpectrometer"
);
MultiLog
log
(
"edd::GatedSpectrometer"
);
DadaClientBase
client
(
input_key
,
log
);
DadaClientBase
client
(
input_key
,
log
);
//client.cuda_register_memory();
std
::
size_t
buffer_bytes
=
client
.
data_buffer_size
();
std
::
size_t
buffer_bytes
=
client
.
data_buffer_size
();
std
::
cout
<<
"Running with output_type: "
<<
output_type
<<
std
::
endl
;
std
::
cout
<<
"Running with output_type: "
<<
output_type
<<
std
::
endl
;
if
(
output_type
==
"file"
)
if
(
output_type
==
"file"
)
{
{
SimpleFileWriter
sink
(
filename
);
SimpleFileWriter
sink
(
filename
);
effelsberg
::
edd
::
GatedSpectrometer
<
decltype
(
sink
),
T
>
spectrometer
(
effelsberg
::
edd
::
GatedSpectrometer
<
decltype
(
sink
),
T
>
spectrometer
(
buffer_bytes
,
nSideChannels
,
selectedSideChannel
,
selectedBit
,
buffer_bytes
,
nSideChannels
,
selectedSideChannel
,
selectedBit
,
...
@@ -64,11 +59,10 @@ void launchSpectrometer(std::string const &output_type, key_t input_key, std::st
...
@@ -64,11 +59,10 @@ void launchSpectrometer(std::string const &output_type, key_t input_key, std::st
{
{
throw
std
::
runtime_error
(
"Unknown oputput-type"
);
throw
std
::
runtime_error
(
"Unknown oputput-type"
);
}
}
}
}
int
main
(
int
argc
,
char
**
argv
)
{
int
main
(
int
argc
,
char
**
argv
)
{
try
{
try
{
key_t
input_key
;
key_t
input_key
;
...
@@ -88,6 +82,7 @@ int main(int argc, char **argv) {
...
@@ -88,6 +82,7 @@ int main(int argc, char **argv) {
std
::
string
filename
(
buffer
);
std
::
string
filename
(
buffer
);
std
::
string
output_type
=
"file"
;
std
::
string
output_type
=
"file"
;
unsigned
int
output_bit_depth
;
unsigned
int
output_bit_depth
;
/** Define and parse the program options
/** Define and parse the program options
*/
*/
namespace
po
=
boost
::
program_options
;
namespace
po
=
boost
::
program_options
;
...
@@ -189,32 +184,23 @@ int main(int argc, char **argv) {
...
@@ -189,32 +184,23 @@ int main(int argc, char **argv) {
return
ERROR_IN_COMMAND_LINE
;
return
ERROR_IN_COMMAND_LINE
;
}
}
/**
* All the application code goes here
*/
if
(
output_bit_depth
==
8
)
if
(
output_bit_depth
==
8
)
{
{
launchSpectrometer
<
int8_t
>
(
output_type
,
input_key
,
filename
,
nSideChannels
,
selectedSideChannel
,
selectedBit
,
speadHeapSize
,
launchSpectrometer
<
int8_t
>
(
output_type
,
input_key
,
filename
,
fft_length
,
naccumulat
e
,
nSideChannels
,
selectedSideChannel
,
selectedBit
,
speadHeapSiz
e
,
nbits
,
input_level
,
output_level
);
fft_length
,
naccumulate
,
nbits
,
input_level
,
output_level
);
}
}
else
if
(
output_bit_depth
==
32
)
else
if
(
output_bit_depth
==
32
)
{
{
launchSpectrometer
<
float
>
(
output_type
,
input_key
,
filename
,
nSideChannels
,
selectedSideChannel
,
selectedBit
,
speadHeapSize
,
launchSpectrometer
<
float
>
(
output_type
,
input_key
,
filename
,
fft_length
,
naccumulat
e
,
nSideChannels
,
selectedSideChannel
,
selectedBit
,
speadHeapSiz
e
,
nbits
,
input_level
,
output_level
);
fft_length
,
naccumulate
,
nbits
,
input_level
,
output_level
);
}
}
else
else
{
{
throw
po
::
validation_error
(
po
::
validation_error
::
invalid_option_value
,
"Output bit depth must be 8 or 32"
);
throw
po
::
validation_error
(
po
::
validation_error
::
invalid_option_value
,
"Output bit depth must be 8 or 32"
);
}
}
/**
* End of application code
*/
}
catch
(
std
::
exception
&
e
)
{
}
catch
(
std
::
exception
&
e
)
{
std
::
cerr
<<
"Unhandled Exception reached the top of main: "
<<
e
.
what
()
std
::
cerr
<<
"Unhandled Exception reached the top of main: "
<<
e
.
what
()
<<
", application will now exit"
<<
std
::
endl
;
<<
", application will now exit"
<<
std
::
endl
;
...
...
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