Skip to content

Commit c58a631

Browse files
committed
benchdnn: graph: fix create memory from scalar lt
1 parent b6c7433 commit c58a631

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());
@@ -94,9 +93,11 @@ dnn_graph_mem_t::dnn_graph_mem_t(const dnn_mem_t &mem,
9493

9594
// Create memory for graph path
9695
const auto data_type = static_cast<dnnl::memory::data_type>(graph_dt);
96+
97+
if (graph_dims_.empty()) graph_dims_.push_back(1);
98+
if (graph_strides_.empty()) graph_strides_.push_back(1);
99+
97100
if (is_op_input) {
98-
if (graph_dims_.empty()) graph_dims_.push_back(1);
99-
if (graph_strides_.empty()) graph_strides_.push_back(1);
100101

101102
// create graph memory
102103
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)