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
455d488f
Commit
455d488f
authored
Aug 14, 2023
by
Brian Pickrell
Browse files
fix test bug in compute()
parent
2ef739bd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
12 deletions
+8
-12
src/include/migraphx/op/rand_uniform.hpp
src/include/migraphx/op/rand_uniform.hpp
+6
-5
test/ref_ops_test.cpp
test/ref_ops_test.cpp
+2
-7
No files found.
src/include/migraphx/op/rand_uniform.hpp
View file @
455d488f
...
...
@@ -31,7 +31,7 @@
*
* Inputs: (1) randomization seed (uint32)
* (2) the shape of the set to be populated.
*
*
*
* Attributes: none
*
...
...
@@ -91,10 +91,11 @@ struct rand_uniform
}
}
argument
compute
(
const
shape
&
output
,
std
::
vector
<
argument
>
&
args
)
const
argument
compute
(
const
shape
&
output
,
std
::
vector
<
argument
>
args
)
const
{
(
void
)
output
;
argument
&
result
{
args
[
1
]};
// Output goes into the passed buffer, not the shape output
(
void
)
output
;
argument
result
{
args
[
1
].
get_shape
()};
uint32_t
local_seed
=
args
[
0
].
at
<
uint32_t
>
(
0
);
...
...
@@ -105,7 +106,7 @@ struct rand_uniform
});
return
result
;
}
std
::
ptrdiff_t
output_alias
(
const
std
::
vector
<
shape
>&
)
const
{
return
1
;
}
};
...
...
test/ref_ops_test.cpp
View file @
455d488f
...
...
@@ -6508,12 +6508,7 @@ TEST_CASE(rand_uniform_dyn_test)
migraphx::shape seed_shape{migraphx::shape::uint32_type, {1}};
auto seed_input = mm->add_parameter("Seed", seed_shape);
mm->add_instruction(migraphx::make_op("rand_uniform",
{
{"seed", seed + 1},
}),
input,
seed_input);
mm->add_instruction(migraphx::make_op("rand_uniform", {}), seed_input, input);
p.compile(migraphx::make_target("ref"));
// Create a dummy input to hold the random data
...
...
@@ -6550,7 +6545,7 @@ TEST_CASE(rand_uniform_and_seed_test)
// Runtime randomization seed
auto seed_input = mm->add_instruction(migraphx::make_op("random_seed"));
mm->add_instruction(migraphx::make_op("rand_uniform"), input,
seed_
input);
mm->add_instruction(migraphx::make_op("rand_uniform"),
seed_
input, input);
p.compile(migraphx::make_target("ref"));
// Create a dummy input to hold the random data
...
...
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