Skip to content

Commit 13d0901

Browse files
committed
benchdnn: graph: fix create memory from scalar lt
1 parent a3eb3c1 commit 13d0901

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

tests/benchdnn/graph/graph_memory.cpp

+7-6
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,10 @@ dnn_graph_mem_t::dnn_graph_mem_t(
5151

5252
const auto &g_eng = get_graph_engine().operator const dnnl::engine &();
5353

54-
if (is_op_input) {
55-
56-
if (graph_dims_.empty()) graph_dims_.push_back(1);
57-
if (graph_strides_.empty()) graph_strides_.push_back(1);
54+
if (graph_dims_.empty()) graph_dims_.push_back(1);
55+
if (graph_strides_.empty()) graph_strides_.push_back(1);
5856

57+
if (is_op_input) {
5958
// create graph memory
6059
dnnl::memory::desc md(graph_dims_, data_type, graph_strides_);
6160
mem_ = dnn_mem_t(md.get(), g_eng.get());
@@ -101,9 +100,11 @@ dnn_graph_mem_t::dnn_graph_mem_t(const dnn_mem_t &mem,
101100

102101
// Create memory for graph path
103102
const auto data_type = static_cast<dnnl::memory::data_type>(graph_dt);
103+
104+
if (graph_dims_.empty()) graph_dims_.push_back(1);
105+
if (graph_strides_.empty()) graph_strides_.push_back(1);
106+
104107
if (is_op_input) {
105-
if (graph_dims_.empty()) graph_dims_.push_back(1);
106-
if (graph_strides_.empty()) graph_strides_.push_back(1);
107108

108109
// create graph memory
109110
dnnl::memory::desc md(graph_dims_, data_type, graph_strides_);

tests/benchdnn/graph/setting_handler.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -1627,7 +1627,6 @@ bool get_reduction_prb_vdims(
16271627
}
16281628

16291629
prb_vdims.vdims = {src_dims, dst_dims};
1630-
prb_vdims.dst_dims = src_dims;
16311630
prb_vdims.ndims = static_cast<int>(src_dims.size());
16321631
return true;
16331632
}

0 commit comments

Comments
 (0)