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
d6e1a821
Commit
d6e1a821
authored
Jun 01, 2023
by
Po-Yen, Chen
Browse files
Avoid invoking (host) STL algorithms
parent
3dc20da8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
include/ck/utility/amd_wave_read_first_lane.hpp
include/ck/utility/amd_wave_read_first_lane.hpp
+17
-6
No files found.
include/ck/utility/amd_wave_read_first_lane.hpp
View file @
d6e1a821
...
...
@@ -7,7 +7,6 @@
#include "ck/utility/functional2.hpp"
#include "ck/utility/math.hpp"
#include <algorithm>
#include <array>
#include <cstddef>
#include <cstdint>
...
...
@@ -44,24 +43,36 @@ struct get_carrier<3>
public:
__device__
inline
carrier
(
value_type
value
)
noexcept
{
std
::
copy_n
(
reinterpret_cast
<
const
std
::
byte
*>
(
&
value
),
bytes
.
size
(),
bytes
.
data
());
auto
from
=
reinterpret_cast
<
const
std
::
byte
*>
(
&
value
);
for
(
auto
to
=
bytes
.
begin
();
to
!=
bytes
.
end
();
++
to
,
++
from
)
{
*
to
=
*
from
;
}
}
// method to trigger template substitution failure
__device__
inline
carrier
&
operator
=
(
const
carrier
&
other
)
noexcept
{
std
::
copy_n
(
other
.
bytes
.
data
(),
bytes
.
size
(),
bytes
.
data
());
auto
from
=
other
.
bytes
.
begin
();
for
(
auto
to
=
bytes
.
begin
();
to
!=
bytes
.
end
();
++
to
,
++
from
)
{
*
to
=
*
from
;
}
return
*
this
;
}
__device__
inline
operator
value_type
()
const
noexcept
{
std
::
array
<
std
::
byte
,
sizeof
(
value_type
)
>
value
;
std
::
byte
result
[
sizeof
(
value_type
)
]
;
std
::
copy_n
(
bytes
.
data
(),
bytes
.
size
(),
value
.
data
());
auto
to
=
result
;
for
(
auto
from
=
bytes
.
begin
();
from
!=
bytes
.
end
();
++
to
,
++
from
)
{
*
to
=
*
from
;
}
return
*
reinterpret_cast
<
const
value_type
*>
(
value
.
data
()
);
return
*
reinterpret_cast
<
const
value_type
*>
(
result
);
}
};
};
...
...
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