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
ac5e2976
Commit
ac5e2976
authored
Jan 24, 2019
by
Shucai Xiao
Browse files
clang format
parent
f23196d4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
8 deletions
+8
-8
src/include/migraphx/operators.hpp
src/include/migraphx/operators.hpp
+1
-1
test/cpu_ops_test.cpp
test/cpu_ops_test.cpp
+2
-2
test/gpu/miopen.cpp
test/gpu/miopen.cpp
+2
-2
test/onnx/onnx_test.cpp
test/onnx/onnx_test.cpp
+3
-3
No files found.
src/include/migraphx/operators.hpp
View file @
ac5e2976
...
@@ -649,7 +649,7 @@ struct gather
...
@@ -649,7 +649,7 @@ struct gather
}
}
// negative axis means counting dimensions from back
// negative axis means counting dimensions from back
if
(
axis
<
0
)
if
(
axis
<
0
)
{
{
axis
+=
n_dim
;
axis
+=
n_dim
;
}
}
...
...
test/cpu_ops_test.cpp
View file @
ac5e2976
...
@@ -112,7 +112,7 @@ TEST_CASE(gather_test)
...
@@ -112,7 +112,7 @@ TEST_CASE(gather_test)
auto
a0
=
p
.
add_literal
(
migraphx
::
literal
{
s
,
data
});
auto
a0
=
p
.
add_literal
(
migraphx
::
literal
{
s
,
data
});
migraphx
::
shape
s_indices
{
migraphx
::
shape
::
int32_type
,
{
1
,
2
}};
migraphx
::
shape
s_indices
{
migraphx
::
shape
::
int32_type
,
{
1
,
2
}};
std
::
vector
<
int
>
indices
{
0
,
2
};
std
::
vector
<
int
>
indices
{
0
,
2
};
auto
a1
=
p
.
add_literal
(
migraphx
::
literal
{
s_indices
,
indices
});
auto
a1
=
p
.
add_literal
(
migraphx
::
literal
{
s_indices
,
indices
});
int
axis
=
0
;
int
axis
=
0
;
p
.
add_instruction
(
migraphx
::
op
::
gather
{
axis
},
a0
,
a1
);
p
.
add_instruction
(
migraphx
::
op
::
gather
{
axis
},
a0
,
a1
);
p
.
compile
(
migraphx
::
cpu
::
target
{});
p
.
compile
(
migraphx
::
cpu
::
target
{});
...
@@ -132,7 +132,7 @@ TEST_CASE(gather_test)
...
@@ -132,7 +132,7 @@ TEST_CASE(gather_test)
auto
a0
=
p
.
add_literal
(
migraphx
::
literal
{
s
,
data
});
auto
a0
=
p
.
add_literal
(
migraphx
::
literal
{
s
,
data
});
migraphx
::
shape
s_indices
{
migraphx
::
shape
::
int32_type
,
{
1
,
2
}};
migraphx
::
shape
s_indices
{
migraphx
::
shape
::
int32_type
,
{
1
,
2
}};
std
::
vector
<
int
>
indices
{
0
,
2
};
std
::
vector
<
int
>
indices
{
0
,
2
};
auto
a1
=
p
.
add_literal
(
migraphx
::
literal
{
s_indices
,
indices
});
auto
a1
=
p
.
add_literal
(
migraphx
::
literal
{
s_indices
,
indices
});
int
axis
=
1
;
int
axis
=
1
;
p
.
add_instruction
(
migraphx
::
op
::
gather
{
axis
},
a0
,
a1
);
p
.
add_instruction
(
migraphx
::
op
::
gather
{
axis
},
a0
,
a1
);
p
.
compile
(
migraphx
::
cpu
::
target
{});
p
.
compile
(
migraphx
::
cpu
::
target
{});
...
...
test/gpu/miopen.cpp
View file @
ac5e2976
...
@@ -942,8 +942,8 @@ struct test_gather
...
@@ -942,8 +942,8 @@ struct test_gather
migraphx
::
shape
s
{
migraphx
::
shape
::
float_type
,
{
3
,
3
}};
migraphx
::
shape
s
{
migraphx
::
shape
::
float_type
,
{
3
,
3
}};
migraphx
::
shape
s_indices
{
migraphx
::
shape
::
int32_type
,
{
2
,
2
}};
migraphx
::
shape
s_indices
{
migraphx
::
shape
::
int32_type
,
{
2
,
2
}};
std
::
vector
<
int
>
indices
{
1
,
2
,
2
,
1
};
std
::
vector
<
int
>
indices
{
1
,
2
,
2
,
1
};
auto
a0
=
p
.
add_parameter
(
"data"
,
s
);
auto
a0
=
p
.
add_parameter
(
"data"
,
s
);
auto
a1
=
p
.
add_literal
(
migraphx
::
literal
{
s_indices
,
indices
});
auto
a1
=
p
.
add_literal
(
migraphx
::
literal
{
s_indices
,
indices
});
int
axis
=
0
;
int
axis
=
0
;
p
.
add_instruction
(
migraphx
::
op
::
gather
{
axis
},
a0
,
a1
);
p
.
add_instruction
(
migraphx
::
op
::
gather
{
axis
},
a0
,
a1
);
return
p
;
return
p
;
...
...
test/onnx/onnx_test.cpp
View file @
ac5e2976
...
@@ -415,8 +415,8 @@ TEST_CASE(shape_test)
...
@@ -415,8 +415,8 @@ TEST_CASE(shape_test)
TEST_CASE
(
gather_test
)
TEST_CASE
(
gather_test
)
{
{
migraphx
::
program
p
;
migraphx
::
program
p
;
auto
l0
=
p
.
add_parameter
(
"data"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
3
,
4
,
5
,
6
}});
auto
l0
=
p
.
add_parameter
(
"data"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
3
,
4
,
5
,
6
}});
auto
l1
=
p
.
add_parameter
(
"indices"
,
migraphx
::
shape
{
migraphx
::
shape
::
int32_type
,
{
2
,
3
}});
auto
l1
=
p
.
add_parameter
(
"indices"
,
migraphx
::
shape
{
migraphx
::
shape
::
int32_type
,
{
2
,
3
}});
int
axis
=
1
;
int
axis
=
1
;
p
.
add_instruction
(
migraphx
::
op
::
gather
{
axis
},
l0
,
l1
);
p
.
add_instruction
(
migraphx
::
op
::
gather
{
axis
},
l0
,
l1
);
auto
prog
=
migraphx
::
parse_onnx
(
"gather_test.onnx"
);
auto
prog
=
migraphx
::
parse_onnx
(
"gather_test.onnx"
);
...
@@ -431,7 +431,7 @@ TEST_CASE(shape_gather_test)
...
@@ -431,7 +431,7 @@ TEST_CASE(shape_gather_test)
auto
l1
=
auto
l1
=
p
.
add_literal
(
migraphx
::
shape
{
migraphx
::
shape
::
int64_type
,
{
3
}},
l0
->
get_shape
().
lens
());
p
.
add_literal
(
migraphx
::
shape
{
migraphx
::
shape
::
int64_type
,
{
3
}},
l0
->
get_shape
().
lens
());
migraphx
::
shape
const_shape
{
migraphx
::
shape
::
int32_type
,
{
1
}};
migraphx
::
shape
const_shape
{
migraphx
::
shape
::
int32_type
,
{
1
}};
auto
l2
=
p
.
add_literal
(
migraphx
::
literal
{
const_shape
,
{
1
}});
auto
l2
=
p
.
add_literal
(
migraphx
::
literal
{
const_shape
,
{
1
}});
int
axis
=
0
;
int
axis
=
0
;
p
.
add_instruction
(
migraphx
::
op
::
gather
{
axis
},
l1
,
l2
);
p
.
add_instruction
(
migraphx
::
op
::
gather
{
axis
},
l1
,
l2
);
auto
prog
=
migraphx
::
parse_onnx
(
"shape_gather.onnx"
);
auto
prog
=
migraphx
::
parse_onnx
(
"shape_gather.onnx"
);
...
...
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