Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MPIfR-BDG
psrdada_cpp
Commits
f4d097c8
Commit
f4d097c8
authored
Mar 14, 2019
by
Tobias Winchen
Browse files
Fixed comparison between signed and unsigned integer expressions
parent
7bfc1271
Changes
6
Hide whitespace changes
Inline
Side-by-side
psrdada_cpp/effelsberg/edd/test/src/GatedSpectrometerTest.cu
View file @
f4d097c8
...
...
@@ -122,7 +122,7 @@ TEST(GatedSpectrometer, countBitSet) {
psrdada_cpp
::
effelsberg
::
edd
::
countBitSet
<<<
(
_sideChannelData
.
size
()
+
255
)
/
256
,
256
>>>
(
sideCD
,
nBlocks
,
0
,
1
,
0
,
thrust
::
raw_pointer_cast
(
res
.
data
()));
EXPECT_EQ
(
res
[
0
],
0
);
EXPECT_EQ
(
res
[
0
],
0
u
);
res
[
0
]
=
0
;
thrust
::
fill
(
_sideChannelData
.
begin
(),
_sideChannelData
.
end
(),
1L
);
...
...
@@ -139,7 +139,7 @@ TEST(GatedSpectrometer, countBitSet) {
psrdada_cpp
::
effelsberg
::
edd
::
countBitSet
<<<
(
_sideChannelData
.
size
()
+
255
)
/
256
,
256
>>>
(
sideCD
,
nBlocks
,
0
,
nSideChannels
,
3
,
thrust
::
raw_pointer_cast
(
res
.
data
()));
EXPECT_EQ
(
res
[
0
],
0
);
EXPECT_EQ
(
res
[
0
],
0
u
);
res
[
0
]
=
0
;
psrdada_cpp
::
effelsberg
::
edd
::
countBitSet
<<<
(
_sideChannelData
.
size
()
+
255
)
/
256
,
256
>>>
(
...
...
psrdada_cpp/effelsberg/edd/test/src/UnpackerTester.cu
View file @
f4d097c8
...
...
@@ -218,7 +218,7 @@ TEST_F(UnpackerTester, 12_bit_unpack_test)
std
::
default_random_engine
generator
;
std
::
uniform_int_distribution
<
int
>
distribution
(
1
,
1
<<
31
);
InputType
host_input
(
n
);
for
(
in
t
ii
=
0
;
ii
<
n
;
++
ii
)
for
(
size_
t
ii
=
0
;
ii
<
n
;
++
ii
)
{
host_input
[
ii
]
=
distribution
(
generator
);
}
...
...
@@ -237,7 +237,7 @@ TEST_F(UnpackerTester, 8_bit_unpack_test)
std
::
default_random_engine
generator
;
std
::
uniform_int_distribution
<
int
>
distribution
(
1
,
1
<<
31
);
InputType
host_input
(
n
);
for
(
in
t
ii
=
0
;
ii
<
n
;
++
ii
)
for
(
size_
t
ii
=
0
;
ii
<
n
;
++
ii
)
{
host_input
[
ii
]
=
distribution
(
generator
);
}
...
...
psrdada_cpp/meerkat/fbfuse/test/src/CoherentBeamformerTester.cu
View file @
f4d097c8
...
...
@@ -139,7 +139,7 @@ void CoherentBeamformerTester::compare_against_host(
_config
.
npol
(),
_config
.
cb_power_scaling
(),
_config
.
cb_power_offset
());
for
(
in
t
ii
=
0
;
ii
<
btf_powers_host
.
size
();
++
ii
)
for
(
size_
t
ii
=
0
;
ii
<
btf_powers_host
.
size
();
++
ii
)
{
ASSERT_TRUE
(
std
::
abs
(
static_cast
<
int
>
(
btf_powers_host
[
ii
])
-
btf_powers_cuda
[
ii
])
<=
1
);
}
...
...
@@ -164,13 +164,13 @@ TEST_F(CoherentBeamformerTester, representative_noise_test)
int
nsamples
=
_config
.
nsamples_per_heap
()
*
ntimestamps
;
std
::
size_t
weights_size
=
_config
.
cb_nantennas
()
*
_config
.
nchans
()
*
_config
.
cb_nbeams
();
HostVoltageVectorType
ftpa_voltages_host
(
input_size
);
for
(
in
t
ii
=
0
;
ii
<
ftpa_voltages_host
.
size
();
++
ii
)
for
(
size_
t
ii
=
0
;
ii
<
ftpa_voltages_host
.
size
();
++
ii
)
{
ftpa_voltages_host
[
ii
].
x
=
static_cast
<
int8_t
>
(
std
::
lround
(
normal_dist
(
generator
)));
ftpa_voltages_host
[
ii
].
y
=
static_cast
<
int8_t
>
(
std
::
lround
(
normal_dist
(
generator
)));
}
HostWeightsVectorType
fbpa_weights_host
(
weights_size
);
for
(
in
t
ii
=
0
;
ii
<
fbpa_weights_host
.
size
();
++
ii
)
for
(
size_
t
ii
=
0
;
ii
<
fbpa_weights_host
.
size
();
++
ii
)
{
// Build complex weight as C * exp(i * theta).
std
::
complex
<
double
>
val
=
127.0
f
*
std
::
exp
(
std
::
complex
<
float
>
(
0.0
f
,
uniform_dist
(
generator
)));
...
...
psrdada_cpp/meerkat/fbfuse/test/src/IncoherentBeamformerTester.cu
View file @
f4d097c8
...
...
@@ -115,10 +115,10 @@ void IncoherentBeamformerTester::compare_against_host(
_config
.
nsamples_per_heap
(),
_config
.
ib_power_scaling
(),
_config
.
ib_power_offset
());
for
(
in
t
ii
=
0
;
ii
<
tf_powers_host
.
size
();
++
ii
)
for
(
size_
t
ii
=
0
;
ii
<
tf_powers_host
.
size
();
++
ii
)
{
ASSERT_TRUE
(
std
::
abs
(
static_cast
<
int
>
(
tf_powers_host
[
ii
])
-
tf_powers_cuda
[
ii
])
<=
1
);
}
}
}
TEST_F
(
IncoherentBeamformerTester
,
ib_representative_noise_test
)
...
...
@@ -133,7 +133,7 @@ TEST_F(IncoherentBeamformerTester, ib_representative_noise_test)
std
::
size_t
input_size
=
(
ntimestamps
*
_config
.
ib_nantennas
()
*
_config
.
nchans
()
*
_config
.
nsamples_per_heap
()
*
_config
.
npol
());
HostVoltageVectorType
taftp_voltages_host
(
input_size
);
for
(
in
t
ii
=
0
;
ii
<
taftp_voltages_host
.
size
();
++
ii
)
for
(
size_
t
ii
=
0
;
ii
<
taftp_voltages_host
.
size
();
++
ii
)
{
taftp_voltages_host
[
ii
].
x
=
static_cast
<
int8_t
>
(
std
::
lround
(
normal_dist
(
generator
)));
taftp_voltages_host
[
ii
].
y
=
static_cast
<
int8_t
>
(
std
::
lround
(
normal_dist
(
generator
)));
...
...
psrdada_cpp/meerkat/fbfuse/test/src/SplitTransposeTester.cu
View file @
f4d097c8
...
...
@@ -57,9 +57,9 @@ void SplitTransposeTester::transpose_c_reference(
int
input_antenna_idx
=
antenna_idx
+
start_antenna
;
for
(
int
chan_idx
=
0
;
chan_idx
<
nchans
;
++
chan_idx
)
{
for
(
in
t
samp_idx
=
0
;
samp_idx
<
_config
.
nsamples_per_heap
();
++
samp_idx
)
for
(
size_
t
samp_idx
=
0
;
samp_idx
<
_config
.
nsamples_per_heap
();
++
samp_idx
)
{
for
(
in
t
pol_idx
=
0
;
pol_idx
<
_config
.
npol
();
++
pol_idx
)
for
(
size_
t
pol_idx
=
0
;
pol_idx
<
_config
.
npol
();
++
pol_idx
)
{
int
input_idx
=
(
timestamp_idx
*
aftp
+
input_antenna_idx
*
ftp
+
chan_idx
*
tp
+
samp_idx
*
_config
.
npol
()
+
pol_idx
);
...
...
@@ -86,7 +86,7 @@ void SplitTransposeTester::compare_against_host(
_config
.
total_nantennas
(),
_config
.
cb_nantennas
(),
_config
.
cb_antenna_offset
(),
_config
.
nchans
(),
ntimestamps
);
for
(
in
t
ii
=
0
;
ii
<
host_output
.
size
();
++
ii
)
for
(
size_
t
ii
=
0
;
ii
<
host_output
.
size
();
++
ii
)
{
ASSERT_EQ
(
host_output
[
ii
].
x
,
cuda_output
[
ii
].
x
);
ASSERT_EQ
(
host_output
[
ii
].
y
,
cuda_output
[
ii
].
y
);
...
...
@@ -101,7 +101,7 @@ TEST_F(SplitTransposeTester, cycling_prime_test)
*
_config
.
nchans
()
*
_config
.
nsamples_per_heap
()
*
_config
.
npol
());
HostVoltageType
host_gpu_input
(
input_size
);
for
(
in
t
ii
=
0
;
ii
<
input_size
;
++
ii
)
for
(
size_
t
ii
=
0
;
ii
<
input_size
;
++
ii
)
{
host_gpu_input
[
ii
].
x
=
(
ii
%
113
);
host_gpu_input
[
ii
].
y
=
(
ii
%
107
);
...
...
psrdada_cpp/meerkat/fbfuse/test/src/WeightsManagerTester.cu
View file @
f4d097c8
...
...
@@ -85,7 +85,7 @@ void WeightsManagerTester::compare_against_host(
_config
.
channel_frequencies
(),
_config
.
cb_nantennas
(),
_config
.
cb_nbeams
(),
_config
.
channel_frequencies
().
size
(),
epoch
,
0.0
,
1
);
for
(
in
t
ii
=
0
;
ii
<
cuda_weights
.
size
();
++
ii
)
for
(
size_
t
ii
=
0
;
ii
<
cuda_weights
.
size
();
++
ii
)
{
ASSERT_EQ
(
c_weights
[
ii
].
x
,
cuda_weights
[
ii
].
x
);
ASSERT_EQ
(
c_weights
[
ii
].
y
,
cuda_weights
[
ii
].
y
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment