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
MIGraphX
Commits
dac5563d
Commit
dac5563d
authored
Jul 27, 2023
by
umangyadav
Browse files
Merge remote-tracking branch 'upstream/develop' into resnet50_partition
parents
95f2cdb9
7e2a550c
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
2 deletions
+51
-2
test/op_shape_test.cpp
test/op_shape_test.cpp
+26
-0
test/ref_ops_test.cpp
test/ref_ops_test.cpp
+23
-0
tools/te.py
tools/te.py
+2
-2
No files found.
test/op_shape_test.cpp
View file @
dac5563d
...
...
@@ -2190,6 +2190,32 @@ TEST_CASE(prefix_scan_sum)
}
}
TEST_CASE
(
prefix_scan_sum_dyn
)
{
{
std
::
vector
<
migraphx
::
shape
::
dynamic_dimension
>
dd
{{
5
,
8
}};
migraphx
::
shape
s
{
migraphx
::
shape
::
float_type
,
dd
};
expect_shape
(
s
,
migraphx
::
make_op
(
"prefix_scan_sum"
,
{{
"axis"
,
0
},
{
"exclusive"
,
0
},
{
"reverse"
,
0
}}),
s
);
}
}
TEST_CASE
(
prefix_scan_sum_dyn_2d
)
{
{
std
::
vector
<
migraphx
::
shape
::
dynamic_dimension
>
dd
{{
5
,
8
},
{
3
,
7
}};
migraphx
::
shape
s
{
migraphx
::
shape
::
float_type
,
dd
};
expect_shape
(
s
,
migraphx
::
make_op
(
"prefix_scan_sum"
,
{{
"axis"
,
1
},
{
"exclusive"
,
0
},
{
"reverse"
,
0
}}),
s
);
}
}
TEST_CASE
(
quant_convolution_shape
)
{
migraphx
::
shape
output
{
migraphx
::
shape
::
int32_type
,
{
4
,
4
,
1
,
1
}};
...
...
test/ref_ops_test.cpp
View file @
dac5563d
...
...
@@ -5886,6 +5886,29 @@ TEST_CASE(prefix_scan_sum_1d)
EXPECT(results_vector == gold);
}
TEST_CASE(prefix_scan_sum_dyn_1d)
{
migraphx::program p;
auto* mm = p.get_main_module();
std::vector<migraphx::shape::dynamic_dimension> dd{{5, 8}};
migraphx::shape s{migraphx::shape::float_type, dd};
auto input = mm->add_parameter("X", s);
mm->add_instruction(migraphx::make_op("prefix_scan_sum", {{"axis", 0}, {"exclusive", false}}),
input);
p.compile(migraphx::make_target("ref"));
std::vector<float> a = {1, 2, 3, 4, 5, 6};
migraphx::shape input_fixed_shape0{migraphx::shape::float_type, {6}};
migraphx::parameter_map params0;
params0["X"] = migraphx::argument(input_fixed_shape0, a.data());
auto result = p.eval(params0).back();
std::vector<float> results_vector;
result.visit([&](auto output) { results_vector.assign(output.begin(), output.end()); });
std::vector<float> gold{1.0, 3.0, 6.0, 10.0, 15.0, 21.0};
EXPECT(results_vector == gold);
}
TEST_CASE(prefix_scan_sum_2d)
{
{
...
...
tools/te.py
View file @
dac5563d
...
...
@@ -70,7 +70,7 @@ struct ${struct_name}
{
using std::swap;
auto * derived = this->any_cast<PrivateDetailTypeErasedT>();
if(derived and private_detail_te_handle_mem_var.u
nique()
)
if(derived and private_detail_te_handle_mem_var.u
se_count() == 1
)
{
*derived = std::forward<PrivateDetailTypeErasedT>(value);
}
...
...
@@ -181,7 +181,7 @@ private:
private_detail_te_handle_base_type & private_detail_te_get_handle ()
{
assert(private_detail_te_handle_mem_var != nullptr);
if (
not
private_detail_te_handle_mem_var.u
nique()
)
if (private_detail_te_handle_mem_var.u
se_count() > 1
)
private_detail_te_handle_mem_var = private_detail_te_handle_mem_var->clone();
return *private_detail_te_handle_mem_var;
}
...
...
Prev
1
2
Next
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