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
f14d1933
Commit
f14d1933
authored
Mar 12, 2019
by
Tobias Winchen
Browse files
Switched to appropriate unsigned integer types
parent
30450808
Changes
3
Hide whitespace changes
Inline
Side-by-side
psrdada_cpp/effelsberg/edd/GatedSpectrometer.cuh
View file @
f14d1933
...
...
@@ -88,7 +88,7 @@ private:
thrust
::
device_vector
<
RawVoltageType
>
const
&
sideChannelData
,
thrust
::
device_vector
<
IntegratedPowerType
>
&
detected_G0
,
thrust
::
device_vector
<
IntegratedPowerType
>
&
detected_G1
,
thrust
::
device_vector
<
int
>
&
noOfBitSet
);
thrust
::
device_vector
<
unsigned
int
>
&
noOfBitSet
);
private:
std
::
size_t
_buffer_bytes
;
...
...
@@ -116,7 +116,7 @@ private:
DoubleDeviceBuffer
<
IntegratedPowerType
>
_power_db_G0
;
DoubleDeviceBuffer
<
IntegratedPowerType
>
_power_db_G1
;
DoubleDeviceBuffer
<
RawVoltageType
>
_sideChannelData_db
;
DoubleDeviceBuffer
<
int
>
_noOfBitSetsInSideChannel
;
DoubleDeviceBuffer
<
unsigned
int
>
_noOfBitSetsInSideChannel
;
thrust
::
device_vector
<
UnpackedVoltageType
>
_unpacked_voltage_G0
;
thrust
::
device_vector
<
UnpackedVoltageType
>
_unpacked_voltage_G1
;
...
...
@@ -154,8 +154,8 @@ private:
*
*/
__global__
void
gating
(
float
*
G0
,
float
*
G1
,
const
int64_t
*
sideChannelData
,
size_t
N
,
size_t
heapSize
,
int64
_t
bitpos
,
int64
_t
noOfSideChannels
,
int64
_t
selectedSideChannel
);
size_t
N
,
size_t
heapSize
,
size
_t
bitpos
,
size
_t
noOfSideChannels
,
size
_t
selectedSideChannel
);
}
// edd
...
...
psrdada_cpp/effelsberg/edd/detail/GatedSpectrometer.cu
View file @
f14d1933
...
...
@@ -13,8 +13,8 @@ namespace edd {
__global__
void
gating
(
float
*
G0
,
float
*
G1
,
const
int64_t
*
sideChannelData
,
size_t
N
,
size_t
heapSize
,
int64
_t
bitpos
,
int64
_t
noOfSideChannels
,
int64
_t
selectedSideChannel
)
{
size_t
N
,
size_t
heapSize
,
size
_t
bitpos
,
size
_t
noOfSideChannels
,
size
_t
selectedSideChannel
)
{
for
(
int
i
=
blockIdx
.
x
*
blockDim
.
x
+
threadIdx
.
x
;
(
i
<
N
);
i
+=
blockDim
.
x
*
gridDim
.
x
)
{
const
float
w
=
G0
[
i
];
...
...
@@ -32,7 +32,9 @@ __global__ void gating(float *G0, float *G1, const int64_t *sideChannelData,
}
__global__
void
countBitSet
(
const
int64_t
*
sideChannelData
,
size_t
N
,
int64_t
bitpos
,
int64_t
noOfSideChannels
,
int64_t
selectedSideChannel
,
int
*
nBitsSet
)
__global__
void
countBitSet
(
const
int64_t
*
sideChannelData
,
size_t
N
,
size_t
bitpos
,
size_t
noOfSideChannels
,
size_t
selectedSideChannel
,
unsigned
int
*
nBitsSet
)
{
// really not optimized reduction, but here only trivial array sizes.
int
i
=
blockIdx
.
x
*
blockDim
.
x
+
threadIdx
.
x
;
...
...
@@ -181,7 +183,7 @@ void GatedSpectrometer<HandlerType>::process(
thrust
::
device_vector
<
RawVoltageType
>
const
&
digitiser_raw
,
thrust
::
device_vector
<
RawVoltageType
>
const
&
sideChannelData
,
thrust
::
device_vector
<
IntegratedPowerType
>
&
detected_G0
,
thrust
::
device_vector
<
IntegratedPowerType
>
&
detected_G1
,
thrust
::
device_vector
<
int
>
&
noOfBitSet
)
{
thrust
::
device_vector
<
IntegratedPowerType
>
&
detected_G1
,
thrust
::
device_vector
<
unsigned
int
>
&
noOfBitSet
)
{
BOOST_LOG_TRIVIAL
(
debug
)
<<
"Unpacking raw voltages"
;
switch
(
_nbits
)
{
case
8
:
...
...
@@ -300,7 +302,7 @@ bool GatedSpectrometer<HandlerType>::operator()(RawBytes &block) {
int
R
[
1
];
CUDA_ERROR_CHECK
(
cudaMemcpyAsync
(
static_cast
<
void
*>
(
R
),
static_cast
<
void
*>
(
_noOfBitSetsInSideChannel
.
b_ptr
()),
1
*
sizeof
(
int
),
cudaMemcpyDeviceToHost
,
_d2h_stream
));
1
*
sizeof
(
unsigned
int
),
cudaMemcpyDeviceToHost
,
_d2h_stream
));
BOOST_LOG_TRIVIAL
(
info
)
<<
"NOOF BIT SET IN SIDE CHANNEL: "
<<
R
[
0
]
<<
std
::
endl
;
...
...
psrdada_cpp/effelsberg/edd/test/src/GatedSpectrometerTest.cu
View file @
f14d1933
...
...
@@ -115,7 +115,7 @@ TEST(GatedSpectrometer, countBitSet) {
const
int64_t
*
sideCD
=
(
int64_t
*
)(
thrust
::
raw_pointer_cast
(
_sideChannelData
.
data
()));
thrust
::
device_vector
<
int
>
res
(
1
);
thrust
::
device_vector
<
unsigned
int
>
res
(
1
);
// test 1 side channel
res
[
0
]
=
0
;
...
...
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