Skip to content

Commit b0cf3c3

Browse files
committedMar 12, 2024
This fixes test_reorder and adds Acdb8a/Acdb4a reorder target formats.
1. It fixes the test_reorder test by checking whether target supports SVE instructions before executing reorder that uses SVE intrinsics. 2. It also adds Acdb8a and Acdb4a formats to the possible target reorder memory formats.
1 parent 6f8a548 commit b0cf3c3

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed
 

‎src/cpu/aarch64/acl_reorder.hpp

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2023 Arm Ltd. and affiliates
2+
* Copyright 2023-2024 Arm Ltd. and affiliates
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -110,8 +110,8 @@ struct acl_reorder_fwd_t : public primitive_t {
110110
return status::unimplemented;
111111
}
112112

113-
// In case we have two or four dimensions we can't have the first
114-
// two dimensions as 1. This is valid for f32->f32 and f32->bf16.
113+
// In case we have two or four dimensions, we can't have one of the
114+
// two first dimensions as 1. This is valid for f32->f32 and f32->bf16.
115115
if (dst_md->dims[0] == 1 || dst_md->dims[1] == 1) {
116116
return status::unimplemented;
117117
}
@@ -123,17 +123,18 @@ struct acl_reorder_fwd_t : public primitive_t {
123123

124124
auto dst_tag = memory_desc_matches_one_of_tag(*dst_md,
125125
format_tag::BA8b4a, format_tag::BA4b4a, format_tag::Ab4a,
126-
format_tag::Ab8a);
126+
format_tag::Ab8a, format_tag::Acdb8a, format_tag::Acdb4a);
127127
ACL_CHECK_SUPPORT(format_tag::undef == dst_tag,
128-
"Only Ab4a, Ab8a, BA8b4a and BA4b4a destination formats "
129-
"supported");
128+
"Only Ab4a/Ab8a, BA8b4a/BA4b4a and Acdb8a/Acdb4a destination "
129+
" formats supported");
130130

131131
if (dst_tag == format_tag::BA4b4a || dst_tag == format_tag::Acdb4a
132132
|| dst_tag == format_tag::Ab4a) {
133133
_pd->app_.dst_wf = arm_compute::WeightFormat::OHWIo4;
134-
} else if (dst_tag == format_tag::BA8b4a
135-
|| dst_tag == format_tag::Acdb8a
136-
|| dst_tag == format_tag::Ab8a) {
134+
} else if (mayiuse(sve_256)
135+
&& (dst_tag == format_tag::BA8b4a
136+
|| dst_tag == format_tag::Acdb8a
137+
|| dst_tag == format_tag::Ab8a)) {
137138
_pd->app_.dst_wf = arm_compute::WeightFormat::OHWIo8;
138139
} else {
139140
return status::unimplemented;

0 commit comments

Comments
 (0)