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
6ab58fbf
Commit
6ab58fbf
authored
Feb 13, 2022
by
Shucai Xiao
Browse files
changes to fix unit test errors
parent
74a96965
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
9 deletions
+9
-9
src/targets/gpu/hip.cpp
src/targets/gpu/hip.cpp
+4
-4
src/targets/gpu/kernel.cpp
src/targets/gpu/kernel.cpp
+1
-1
src/targets/gpu/kernels/include/migraphx/kernels/roialign.hpp
...targets/gpu/kernels/include/migraphx/kernels/roialign.hpp
+2
-2
test/onnx/onnx_test.cpp
test/onnx/onnx_test.cpp
+2
-2
No files found.
src/targets/gpu/hip.cpp
View file @
6ab58fbf
...
...
@@ -46,7 +46,7 @@ void* get_device_ptr(void* hptr)
return
result
;
}
hip_ptr
allocate_gpu
(
in
t
sz
,
bool
host
=
false
)
hip_ptr
allocate_gpu
(
std
::
size_
t
sz
,
bool
host
=
false
)
{
if
(
sz
>
get_available_gpu_memory
())
MIGRAPHX_THROW
(
"Memory not available to allocate buffer: "
+
std
::
to_string
(
sz
));
...
...
@@ -62,7 +62,7 @@ hip_ptr allocate_gpu(int sz, bool host = false)
return
hip_ptr
{
result
};
}
hip_host_ptr
register_on_gpu
(
void
*
ptr
,
in
t
sz
)
hip_host_ptr
register_on_gpu
(
void
*
ptr
,
std
::
size_
t
sz
)
{
auto
status
=
hipHostRegister
(
ptr
,
sz
,
hipHostRegisterMapped
);
if
(
status
!=
hipSuccess
)
...
...
@@ -71,7 +71,7 @@ hip_host_ptr register_on_gpu(void* ptr, int sz)
}
template
<
class
T
>
std
::
vector
<
T
>
read_from_gpu
(
const
void
*
x
,
in
t
sz
)
std
::
vector
<
T
>
read_from_gpu
(
const
void
*
x
,
std
::
size_
t
sz
)
{
gpu_sync
();
std
::
vector
<
T
>
result
(
sz
);
...
...
@@ -81,7 +81,7 @@ std::vector<T> read_from_gpu(const void* x, int sz)
return
result
;
}
hip_ptr
write_to_gpu
(
const
void
*
x
,
in
t
sz
,
bool
host
=
false
)
hip_ptr
write_to_gpu
(
const
void
*
x
,
std
::
size_
t
sz
,
bool
host
=
false
)
{
gpu_sync
();
auto
result
=
allocate_gpu
(
sz
,
host
);
...
...
src/targets/gpu/kernel.cpp
View file @
6ab58fbf
...
...
@@ -12,7 +12,7 @@ extern hipError_t hipExtModuleLaunchKernel(hipFunction_t, // NOLINT
uint32_t
,
uint32_t
,
uint32_t
,
in
t
,
size_
t
,
hipStream_t
,
void
**
,
void
**
,
...
...
src/targets/gpu/kernels/include/migraphx/kernels/roialign.hpp
View file @
6ab58fbf
...
...
@@ -132,7 +132,7 @@ __device__ void roialign(const T& x_t, const U& rois_t, const V& ind_t, const W&
auto
channel_num
=
x_lens
[
1
];
// input dims of height and width, in all 2-dim arrays, the first dim
// is for height and second dim is for width
array
<
int
,
2
>
in_dims
=
{
x_lens
[
2
],
x_lens
[
3
]};
array
<
int
,
2
>
in_dims
=
{
static_cast
<
int
>
(
x_lens
[
2
]
)
,
static_cast
<
int
>
(
x_lens
[
3
]
)
};
const
auto
stride
=
index
.
nglobal
();
auto
out_s
=
y_t
.
get_shape
();
...
...
@@ -141,7 +141,7 @@ __device__ void roialign(const T& x_t, const U& rois_t, const V& ind_t, const W&
// output dims of height and width, in all 2-dim arrays, the first dim
// is for height and second dim is for width
const
auto
&
out_lens
=
out_s
.
lens
;
array
<
int
,
2
>
out_dims
=
{
out_lens
[
2
],
out_lens
[
3
]};
array
<
int
,
2
>
out_dims
=
{
static_cast
<
int
>
(
out_lens
[
2
]
)
,
static_cast
<
int
>
(
out_lens
[
3
]
)
};
for
(
index_int
i
=
index
.
global
;
i
<
out_s
.
elements
();
i
+=
stride
)
{
...
...
test/onnx/onnx_test.cpp
View file @
6ab58fbf
...
...
@@ -3586,7 +3586,7 @@ TEST_CASE(resize_downsample_linear_test)
EXPECT
(
p
==
prog
);
}
TEST_CASE
(
resize_out
in
test
)
TEST_CASE
(
resize_out
size_
test
)
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
...
...
@@ -3608,7 +3608,7 @@ TEST_CASE(resize_outintest)
auto
r
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"gather"
,
{{
"axis"
,
0
}}),
lrsp
,
li
);
mm
->
add_return
({
r
});
auto
prog
=
migraphx
::
parse_onnx
(
"resize_out
in
test.onnx"
);
auto
prog
=
migraphx
::
parse_onnx
(
"resize_out
size_
test.onnx"
);
EXPECT
(
p
==
prog
);
}
...
...
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