File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1515*******************************************************************************/
1616
1717#include " cpu/aarch64/acl_utils.hpp"
18+ #include < limits>
1819
1920namespace dnnl {
2021namespace impl {
@@ -154,8 +155,12 @@ status_t tensor_info(
154155 for (int i = md.ndims () - 1 ; i >= 0 ; --i) {
155156 // ACL strides are in bytes, oneDNN strides are in numbers of elements,
156157 // multiply by data type size to convert
157- strides_in_bytes.set (
158- acl_stride_i, blocking_desc.strides [i] * md.data_type_size ());
158+ size_t size = blocking_desc.strides [i] * md.data_type_size ();
159+ // ACL stride value is uint32, check for overflow
160+ if (size > std::numeric_limits<uint32_t >::max ()) {
161+ return status::unimplemented;
162+ }
163+ strides_in_bytes.set (acl_stride_i, size);
159164 ++acl_stride_i;
160165 }
161166
You can’t perform that action at this time.
0 commit comments