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
807e585c
Commit
807e585c
authored
May 12, 2021
by
Chao Liu
Browse files
add workaround for ds_write issue for int8x4 and int8x8
parent
5f728f5d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
composable_kernel/include/utility/dynamic_buffer.hpp
composable_kernel/include/utility/dynamic_buffer.hpp
+23
-3
No files found.
composable_kernel/include/utility/dynamic_buffer.hpp
View file @
807e585c
...
@@ -107,14 +107,34 @@ struct DynamicBuffer
...
@@ -107,14 +107,34 @@ struct DynamicBuffer
int8_t
>::
value
)
int8_t
>::
value
)
{
{
static_assert
(
static_assert
(
is_same
<
remove_cv_t
<
remove_reference_t
<
T
>>
,
int8x16_t
>::
value
&&
(
is_same
<
remove_cv_t
<
remove_reference_t
<
T
>>
,
int8x4_t
>::
value
&&
is_same
<
remove_cv_t
<
remove_reference_t
<
X
>>
,
int8x16_t
>::
value
,
is_same
<
remove_cv_t
<
remove_reference_t
<
X
>>
,
int8x4_t
>::
value
)
||
(
is_same
<
remove_cv_t
<
remove_reference_t
<
T
>>
,
int8x8_t
>::
value
&&
is_same
<
remove_cv_t
<
remove_reference_t
<
X
>>
,
int8x8_t
>::
value
)
||
(
is_same
<
remove_cv_t
<
remove_reference_t
<
T
>>
,
int8x16_t
>::
value
&&
is_same
<
remove_cv_t
<
remove_reference_t
<
X
>>
,
int8x16_t
>::
value
),
"wrong! not implemented for this combination, please add implementation"
);
"wrong! not implemented for this combination, please add implementation"
);
if
constexpr
(
is_same
<
remove_cv_t
<
remove_reference_t
<
T
>>
,
int8x4_t
>::
value
&&
is_same
<
remove_cv_t
<
remove_reference_t
<
X
>>
,
int8x4_t
>::
value
)
{
// HACK: cast pointer of x is bad
// TODO: remove this after compiler fix
*
reinterpret_cast
<
int32_t
*>
(
&
p_data_
[
i
])
=
*
reinterpret_cast
<
const
int32_t
*>
(
&
x
);
}
if
constexpr
(
is_same
<
remove_cv_t
<
remove_reference_t
<
T
>>
,
int8x8_t
>::
value
&&
is_same
<
remove_cv_t
<
remove_reference_t
<
X
>>
,
int8x8_t
>::
value
)
{
// HACK: cast pointer of x is bad
// TODO: remove this after compiler fix
*
reinterpret_cast
<
int32x2_t
*>
(
&
p_data_
[
i
])
=
*
reinterpret_cast
<
const
int32x2_t
*>
(
&
x
);
}
if
constexpr
(
is_same
<
remove_cv_t
<
remove_reference_t
<
T
>>
,
int8x16_t
>::
value
&&
if
constexpr
(
is_same
<
remove_cv_t
<
remove_reference_t
<
T
>>
,
int8x16_t
>::
value
&&
is_same
<
remove_cv_t
<
remove_reference_t
<
X
>>
,
int8x16_t
>::
value
)
is_same
<
remove_cv_t
<
remove_reference_t
<
X
>>
,
int8x16_t
>::
value
)
{
{
// HACK: c
ompiler would emit IR "store<i32, 4>" if using this
// HACK: c
ast pointer of x is bad
// TODO: remove this after compiler fix
// TODO: remove this after compiler fix
*
reinterpret_cast
<
int32x4_t
*>
(
&
p_data_
[
i
])
=
*
reinterpret_cast
<
int32x4_t
*>
(
&
p_data_
[
i
])
=
*
reinterpret_cast
<
const
int32x4_t
*>
(
&
x
);
*
reinterpret_cast
<
const
int32x4_t
*>
(
&
x
);
...
...
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