Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
composable_kernel
Commits
1001c731
Commit
1001c731
authored
May 31, 2023
by
Po-Yen, Chen
Browse files
Reorder statements
parent
232972e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
include/ck/utility/amd_wave_read_first_lane.hpp
include/ck/utility/amd_wave_read_first_lane.hpp
+5
-6
No files found.
include/ck/utility/amd_wave_read_first_lane.hpp
View file @
1001c731
...
@@ -54,16 +54,15 @@ __device__ auto amd_wave_read_first_lane(const Object& obj)
...
@@ -54,16 +54,15 @@ __device__ auto amd_wave_read_first_lane(const Object& obj)
constexpr
Size
SgprSize
=
4
;
constexpr
Size
SgprSize
=
4
;
constexpr
Size
ObjectSize
=
sizeof
(
Object
);
constexpr
Size
ObjectSize
=
sizeof
(
Object
);
using
Sgpr
=
detail
::
get_unsigned_int_t
<
SgprSize
>
;
alignas
(
Object
)
std
::
byte
to_obj
[
ObjectSize
];
auto
*
const
from_obj
=
reinterpret_cast
<
const
std
::
byte
*>
(
&
obj
);
auto
*
const
from_obj
=
reinterpret_cast
<
const
std
::
byte
*>
(
&
obj
);
alignas
(
Object
)
std
::
byte
to_obj
[
ObjectSize
];
constexpr
Size
RemainedSize
=
ObjectSize
%
SgprSize
;
constexpr
Size
RemainedSize
=
ObjectSize
%
SgprSize
;
constexpr
Size
CompleteSgprCopyBoundary
=
ObjectSize
-
RemainedSize
;
constexpr
Size
CompleteSgprCopyBoundary
=
ObjectSize
-
RemainedSize
;
for
(
Size
offset
=
0
;
offset
<
CompleteSgprCopyBoundary
;
offset
+=
SgprSize
)
for
(
Size
offset
=
0
;
offset
<
CompleteSgprCopyBoundary
;
offset
+=
SgprSize
)
{
{
using
Sgpr
=
detail
::
get_unsigned_int_t
<
SgprSize
>
;
*
reinterpret_cast
<
Sgpr
*>
(
to_obj
+
offset
)
=
*
reinterpret_cast
<
Sgpr
*>
(
to_obj
+
offset
)
=
amd_wave_read_first_lane
(
*
reinterpret_cast
<
const
Sgpr
*>
(
from_obj
+
offset
));
amd_wave_read_first_lane
(
*
reinterpret_cast
<
const
Sgpr
*>
(
from_obj
+
offset
));
}
}
...
@@ -72,8 +71,8 @@ __device__ auto amd_wave_read_first_lane(const Object& obj)
...
@@ -72,8 +71,8 @@ __device__ auto amd_wave_read_first_lane(const Object& obj)
{
{
using
Carrier
=
detail
::
get_unsigned_int_t
<
RemainedSize
>
;
using
Carrier
=
detail
::
get_unsigned_int_t
<
RemainedSize
>
;
*
reinterpret_cast
<
Carrier
>
(
to_obj
+
CompleteSgprCopyBoundary
)
=
*
reinterpret_cast
<
Carrier
>
(
to_obj
+
CompleteSgprCopyBoundary
)
=
amd_wave_read_first_lane
(
amd_wave_read_first_lane
(
*
reinterpret_cast
<
const
Carrier
*>
(
from_obj
+
CompleteSgprCopyBoundary
));
*
reinterpret_cast
<
const
Carrier
*>
(
from_obj
+
CompleteSgprCopyBoundary
));
}
}
/// NOTE: Implicitly start object lifetime. It's better to use std::start_lifetime_at() in this
/// NOTE: Implicitly start object lifetime. It's better to use std::start_lifetime_at() in this
...
...
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