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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MPIfR-BDG
psrdada_cpp
Commits
fa405f8a
Commit
fa405f8a
authored
Dec 4, 2018
by
Ewan Barr
Browse files
Options
Downloads
Patches
Plain Diff
Unpacker typos
parent
d71038ee
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/Unpacker.cu
+12
-12
12 additions, 12 deletions
psrdada_cpp/effelsberg/edd/src/Unpacker.cu
with
12 additions
and
12 deletions
psrdada_cpp/effelsberg/edd/src/Unpacker.cu
+
12
−
12
View file @
fa405f8a
...
...
@@ -27,8 +27,8 @@ void unpack_edd_12bit_to_float32(uint64_t* __restrict__ in, float* __restrict__
/**
* Note: This kernels will not work with more than 512 threads.
*/
__shared__
volatile
float
tmp_out
[
NTHREADS_UNPACK
*
16
];
__shared__
volatile
uint64_t
tmp_in
[
NTHREADS_UNPACK
*
3
];
__shared__
volatile
float
tmp_out
[
EDD_
NTHREADS_UNPACK
*
16
];
__shared__
volatile
uint64_t
tmp_in
[
EDD_
NTHREADS_UNPACK
*
3
];
int
block_idx
=
blockIdx
.
x
;
uint64_t
val
;
uint64_t
rest
;
...
...
@@ -38,10 +38,10 @@ void unpack_edd_12bit_to_float32(uint64_t* __restrict__ in, float* __restrict__
idx
+=
gridDim
.
x
*
blockDim
.
x
)
{
//Read to shared memeory
int
block_read_start
=
block_idx
*
NTHREADS_UNPACK
*
3
;
int
block_read_start
=
block_idx
*
EDD_
NTHREADS_UNPACK
*
3
;
tmp_in
[
threadIdx
.
x
]
=
in
[
block_read_start
+
threadIdx
.
x
];
tmp_in
[
NTHREADS_UNPACK
+
threadIdx
.
x
]
=
in
[
block_read_start
+
NTHREADS_UNPACK
+
threadIdx
.
x
];
tmp_in
[
NTHREADS_UNPACK
*
2
+
threadIdx
.
x
]
=
in
[
block_read_start
+
NTHREADS_UNPACK
*
2
+
threadIdx
.
x
];
tmp_in
[
EDD_
NTHREADS_UNPACK
+
threadIdx
.
x
]
=
in
[
block_read_start
+
EDD_
NTHREADS_UNPACK
+
threadIdx
.
x
];
tmp_in
[
EDD_
NTHREADS_UNPACK
*
2
+
threadIdx
.
x
]
=
in
[
block_read_start
+
EDD_
NTHREADS_UNPACK
*
2
+
threadIdx
.
x
];
__syncthreads
();
val
=
swap64
(
tmp_in
[
3
*
threadIdx
.
x
]);
sout
[
0
]
=
(
float
)((
int64_t
)((
0xFFF0000000000000
&
val
)
<<
0
)
>>
52
);
...
...
@@ -64,8 +64,8 @@ void unpack_edd_12bit_to_float32(uint64_t* __restrict__ in, float* __restrict__
sout
[
13
]
=
(
float
)((
int64_t
)((
0x0000000FFF000000
&
val
)
<<
28
)
>>
52
);
sout
[
14
]
=
(
float
)((
int64_t
)((
0x0000000000FFF000
&
val
)
<<
40
)
>>
52
);
__syncthreads
();
int
block_write_start
=
block_idx
*
NTHREADS_UNPACK
*
16
;
for
(
int
ii
=
threadIdx
.
x
;
ii
<
16
*
NTHREADS_UNPACK
;
ii
+=
blockDim
.
x
)
int
block_write_start
=
block_idx
*
EDD_
NTHREADS_UNPACK
*
16
;
for
(
int
ii
=
threadIdx
.
x
;
ii
<
16
*
EDD_
NTHREADS_UNPACK
;
ii
+=
blockDim
.
x
)
{
out
[
block_write_start
+
ii
]
=
tmp_out
[
ii
];
}
...
...
@@ -74,19 +74,19 @@ void unpack_edd_12bit_to_float32(uint64_t* __restrict__ in, float* __restrict__
}
__global__
void
unpack_edd_8bit_to_float32
(
uint64_t
*
__restrict__
in
,
float
*
__restrict__
out
,
int
n
)
;
void
unpack_edd_8bit_to_float32
(
uint64_t
*
__restrict__
in
,
float
*
__restrict__
out
,
int
n
)
{
/**
* Note: This kernels will not work with more than 512 threads.
*/
__shared__
volatile
float
tmp_out
[
NTHREADS_UNPACK
*
8
];
__shared__
volatile
float
tmp_out
[
EDD_
NTHREADS_UNPACK
*
8
];
int
block_idx
=
blockIdx
.
x
;
uint64_t
val
;
volatile
float
*
sout
=
tmp_out
+
(
8
*
threadIdx
.
x
);
for
(
int
idx
=
blockIdx
.
x
*
blockDim
.
x
+
threadIdx
.
x
;
idx
<
n
;
idx
+=
gridDim
.
x
*
blockDim
.
x
)
{
int
block_read_start
=
block_idx
*
NTHREADS_UNPACK
;
int
block_read_start
=
block_idx
*
EDD_
NTHREADS_UNPACK
;
val
=
swap64
(
in
[
block_read_start
+
threadIdx
.
x
]);
sout
[
0
]
=
(
float
)((
int64_t
)((
0xFF00000000000000
&
val
)
<<
0
)
>>
56
);
sout
[
1
]
=
(
float
)((
int64_t
)((
0x00FF000000000000
&
val
)
<<
8
)
>>
56
);
...
...
@@ -97,8 +97,8 @@ void unpack_edd_8bit_to_float32(uint64_t* __restrict__ in, float* __restrict__ o
sout
[
6
]
=
(
float
)((
int64_t
)((
0x000000000000FF00
&
val
)
<<
48
)
>>
56
);
sout
[
7
]
=
(
float
)((
int64_t
)((
0x00000000000000FF
&
val
)
<<
56
)
>>
56
);
__syncthreads
();
int
block_write_start
=
block_idx
*
NTHREADS_UNPACK
*
8
;
for
(
int
ii
=
threadIdx
.
x
;
ii
<
8
*
NTHREADS_UNPACK
;
ii
+=
blockDim
.
x
)
int
block_write_start
=
block_idx
*
EDD_
NTHREADS_UNPACK
*
8
;
for
(
int
ii
=
threadIdx
.
x
;
ii
<
8
*
EDD_
NTHREADS_UNPACK
;
ii
+=
blockDim
.
x
)
{
out
[
block_write_start
+
ii
]
=
tmp_out
[
ii
];
}
...
...
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