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
07848b28
Unverified
Commit
07848b28
authored
Oct 19, 2023
by
Paul Fultz II
Committed by
GitHub
Oct 19, 2023
Browse files
Make argument constructor explicit (#2346)
parent
581b1b5f
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
15 additions
and
15 deletions
+15
-15
src/include/migraphx/argument.hpp
src/include/migraphx/argument.hpp
+1
-1
src/include/migraphx/op/allocate.hpp
src/include/migraphx/op/allocate.hpp
+2
-2
src/include/migraphx/op/pooling.hpp
src/include/migraphx/op/pooling.hpp
+2
-2
src/targets/gpu/include/migraphx/gpu/convolution.hpp
src/targets/gpu/include/migraphx/gpu/convolution.hpp
+3
-3
test/eliminate_allocation_test.cpp
test/eliminate_allocation_test.cpp
+1
-1
test/eliminate_concat_test.cpp
test/eliminate_concat_test.cpp
+2
-2
test/memory_coloring_test.cpp
test/memory_coloring_test.cpp
+1
-1
test/normalize_ops_test.cpp
test/normalize_ops_test.cpp
+1
-1
test/replace_allocate.cpp
test/replace_allocate.cpp
+2
-2
No files found.
src/include/migraphx/argument.hpp
View file @
07848b28
...
@@ -46,7 +46,7 @@ struct MIGRAPHX_EXPORT argument : raw_data<argument>
...
@@ -46,7 +46,7 @@ struct MIGRAPHX_EXPORT argument : raw_data<argument>
{
{
argument
()
=
default
;
argument
()
=
default
;
argument
(
const
shape
&
s
);
explicit
argument
(
const
shape
&
s
);
template
<
class
F
,
MIGRAPHX_REQUIRES
(
std
::
is_pointer
<
decltype
(
std
::
declval
<
F
>()())
>
{})
>
template
<
class
F
,
MIGRAPHX_REQUIRES
(
std
::
is_pointer
<
decltype
(
std
::
declval
<
F
>()())
>
{})
>
argument
(
shape
s
,
F
d
)
argument
(
shape
s
,
F
d
)
...
...
src/include/migraphx/op/allocate.hpp
View file @
07848b28
...
@@ -88,13 +88,13 @@ struct allocate
...
@@ -88,13 +88,13 @@ struct allocate
{
{
if
(
args
.
empty
())
if
(
args
.
empty
())
{
{
return
{
output_shape
};
return
argument
{
output_shape
};
}
}
else
else
{
{
std
::
vector
<
std
::
size_t
>
output_dims
(
output_shape
.
ndim
());
std
::
vector
<
std
::
size_t
>
output_dims
(
output_shape
.
ndim
());
args
.
at
(
0
).
visit
([
&
](
auto
a
)
{
output_dims
.
assign
(
a
.
begin
(),
a
.
end
());
});
args
.
at
(
0
).
visit
([
&
](
auto
a
)
{
output_dims
.
assign
(
a
.
begin
(),
a
.
end
());
});
return
{
shape
{
buf_type
,
output_dims
}};
return
argument
{
shape
{
buf_type
,
output_dims
}};
}
}
}
}
};
};
...
...
src/include/migraphx/op/pooling.hpp
View file @
07848b28
...
@@ -411,7 +411,7 @@ struct pooling
...
@@ -411,7 +411,7 @@ struct pooling
// for dynamic GlobalPooling, there's no padding
// for dynamic GlobalPooling, there's no padding
kernel_dims
.
insert
(
kernel_dims
.
end
(),
input_lens
.
begin
()
+
2
,
input_lens
.
end
());
kernel_dims
.
insert
(
kernel_dims
.
end
(),
input_lens
.
begin
()
+
2
,
input_lens
.
end
());
output_shape
=
dyn_out
.
computed_shape
;
output_shape
=
dyn_out
.
computed_shape
;
result
=
dyn_out
.
computed_shape
;
result
=
argument
{
dyn_out
.
computed_shape
}
;
}
}
else
if
((
padding_mode
!=
op
::
padding_mode_t
::
default_
))
else
if
((
padding_mode
!=
op
::
padding_mode_t
::
default_
))
{
{
...
@@ -439,7 +439,7 @@ struct pooling
...
@@ -439,7 +439,7 @@ struct pooling
{
{
kernel_dims
=
this
->
lengths
;
kernel_dims
=
this
->
lengths
;
output_shape
=
dyn_out
.
computed_shape
;
output_shape
=
dyn_out
.
computed_shape
;
result
=
dyn_out
.
computed_shape
;
result
=
argument
{
dyn_out
.
computed_shape
}
;
}
}
// Perform the computation and populate result
// Perform the computation and populate result
...
...
src/targets/gpu/include/migraphx/gpu/convolution.hpp
View file @
07848b28
...
@@ -199,9 +199,9 @@ struct miopen_convolution
...
@@ -199,9 +199,9 @@ struct miopen_convolution
// MIOpen has APIs to pass pre-allocated buffers starting from rocm-5.6
// MIOpen has APIs to pass pre-allocated buffers starting from rocm-5.6
preallocate
=
true
;
preallocate
=
true
;
#endif
#endif
auto
x
=
preallocate
?
to_gpu
(
generate_argument
(
x_shape
))
:
inputs
[
0
];
auto
x
=
preallocate
?
to_gpu
(
generate_argument
(
x_shape
))
:
argument
{
inputs
[
0
]
}
;
auto
w
=
preallocate
?
to_gpu
(
generate_argument
(
w_shape
))
:
inputs
[
1
];
auto
w
=
preallocate
?
to_gpu
(
generate_argument
(
w_shape
))
:
argument
{
inputs
[
1
]
}
;
auto
y
=
preallocate
?
allocate_gpu
(
output_shape
)
:
inputs
[
2
];
auto
y
=
preallocate
?
allocate_gpu
(
output_shape
)
:
argument
{
inputs
[
2
]
}
;
auto
workspace
=
auto
workspace
=
preallocate
?
allocate_gpu
(
workspace_shape
)
:
migraphx
::
argument
(
workspace_shape
);
preallocate
?
allocate_gpu
(
workspace_shape
)
:
migraphx
::
argument
(
workspace_shape
);
...
...
test/eliminate_allocation_test.cpp
View file @
07848b28
...
@@ -55,7 +55,7 @@ struct allocate
...
@@ -55,7 +55,7 @@ struct allocate
const
migraphx
::
shape
&
output_shape
,
const
migraphx
::
shape
&
output_shape
,
const
std
::
vector
<
migraphx
::
argument
>&
)
const
const
std
::
vector
<
migraphx
::
argument
>&
)
const
{
{
return
{
output_shape
};
return
migraphx
::
argument
{
output_shape
};
}
}
};
};
...
...
test/eliminate_concat_test.cpp
View file @
07848b28
...
@@ -60,7 +60,7 @@ struct concat
...
@@ -60,7 +60,7 @@ struct concat
const
migraphx
::
shape
&
output_shape
,
const
migraphx
::
shape
&
output_shape
,
const
std
::
vector
<
migraphx
::
argument
>&
)
const
const
std
::
vector
<
migraphx
::
argument
>&
)
const
{
{
return
{
output_shape
};
return
migraphx
::
argument
{
output_shape
};
}
}
};
};
...
@@ -104,7 +104,7 @@ struct allocate
...
@@ -104,7 +104,7 @@ struct allocate
const
migraphx
::
shape
&
output_shape
,
const
migraphx
::
shape
&
output_shape
,
const
std
::
vector
<
migraphx
::
argument
>&
)
const
const
std
::
vector
<
migraphx
::
argument
>&
)
const
{
{
return
{
output_shape
};
return
migraphx
::
argument
{
output_shape
};
}
}
};
};
...
...
test/memory_coloring_test.cpp
View file @
07848b28
...
@@ -55,7 +55,7 @@ struct allocate
...
@@ -55,7 +55,7 @@ struct allocate
const
migraphx
::
shape
&
output_shape
,
const
migraphx
::
shape
&
output_shape
,
const
std
::
vector
<
migraphx
::
argument
>&
)
const
const
std
::
vector
<
migraphx
::
argument
>&
)
const
{
{
return
{
output_shape
};
return
migraphx
::
argument
{
output_shape
};
}
}
};
};
...
...
test/normalize_ops_test.cpp
View file @
07848b28
...
@@ -57,7 +57,7 @@ struct normalize_test_op
...
@@ -57,7 +57,7 @@ struct normalize_test_op
const
migraphx
::
shape
&
output_shape
,
const
migraphx
::
shape
&
output_shape
,
const
std
::
vector
<
migraphx
::
argument
>&
)
const
const
std
::
vector
<
migraphx
::
argument
>&
)
const
{
{
return
{
output_shape
};
return
migraphx
::
argument
{
output_shape
};
}
}
};
};
...
...
test/replace_allocate.cpp
View file @
07848b28
...
@@ -54,7 +54,7 @@ struct allocate_no_out : migraphx::auto_register_op<allocate_no_out>
...
@@ -54,7 +54,7 @@ struct allocate_no_out : migraphx::auto_register_op<allocate_no_out>
const
migraphx
::
shape
&
output_shape
,
const
migraphx
::
shape
&
output_shape
,
const
std
::
vector
<
migraphx
::
argument
>&
)
const
const
std
::
vector
<
migraphx
::
argument
>&
)
const
{
{
return
{
output_shape
};
return
migraphx
::
argument
{
output_shape
};
}
}
};
};
...
@@ -78,7 +78,7 @@ struct allocate_with_out : migraphx::auto_register_op<allocate_with_out>
...
@@ -78,7 +78,7 @@ struct allocate_with_out : migraphx::auto_register_op<allocate_with_out>
const
migraphx
::
shape
&
output_shape
,
const
migraphx
::
shape
&
output_shape
,
const
std
::
vector
<
migraphx
::
argument
>&
)
const
const
std
::
vector
<
migraphx
::
argument
>&
)
const
{
{
return
{
output_shape
};
return
migraphx
::
argument
{
output_shape
};
}
}
};
};
...
...
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