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
6e6c4add
"docs/archive_en_US/Tutorial/WebUI.md" did not exist on "b5e4d15dab7a282db0aab4aa30109873234aa6d8"
Commit
6e6c4add
authored
Jul 22, 2022
by
Ted Themistokleous
Browse files
fixup! fixup! Make divzero a builtin instead of op
parent
e7ec015d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
7 deletions
+5
-7
src/include/migraphx/module.hpp
src/include/migraphx/module.hpp
+1
-1
src/module.cpp
src/module.cpp
+3
-5
src/program.cpp
src/program.cpp
+1
-1
No files found.
src/include/migraphx/module.hpp
View file @
6e6c4add
...
@@ -184,7 +184,7 @@ struct module
...
@@ -184,7 +184,7 @@ struct module
instruction_ref
validate
()
const
;
instruction_ref
validate
()
const
;
instruction_ref
find_dangling_reference
()
const
;
instruction_ref
find_dangling_reference
()
const
;
instruction_ref
f
lag
_division_by_zero
()
const
;
instruction_ref
f
ind
_division_by_zero
()
const
;
void
finalize
(
context
&
ctx
);
void
finalize
(
context
&
ctx
);
...
...
src/module.cpp
View file @
6e6c4add
...
@@ -639,13 +639,11 @@ instruction_ref module::find_dangling_reference() const
...
@@ -639,13 +639,11 @@ instruction_ref module::find_dangling_reference() const
bool
is_div_zero
(
instruction
ins
)
{
return
ins
.
name
()
==
"@divzero"
;
}
bool
is_div_zero
(
instruction
ins
)
{
return
ins
.
name
()
==
"@divzero"
;
}
instruction_ref
module
::
f
lag
_division_by_zero
()
const
instruction_ref
module
::
f
ind
_division_by_zero
()
const
{
{
auto
divzero
=
std
::
count_if
(
begin
(),
end
(),
[](
auto
x
)
{
return
is_div_zero
(
x
);
});
auto
divzero
=
std
::
find_if
(
begin
(),
end
(),
[](
auto
x
)
{
return
is_div_zero
(
x
);
});
if
(
divzero
>
0
)
return
begin
();
return
end
()
;
return
divzero
;
}
}
void
module
::
finalize
(
context
&
ctx
)
void
module
::
finalize
(
context
&
ctx
)
...
...
src/program.cpp
View file @
6e6c4add
...
@@ -195,7 +195,7 @@ void program::compile(const target& t, compile_options options)
...
@@ -195,7 +195,7 @@ void program::compile(const target& t, compile_options options)
std
::
to_string
(
index
));
std
::
to_string
(
index
));
}
}
auto
divide_by_zero
=
mod
->
f
lag
_division_by_zero
();
auto
divide_by_zero
=
mod
->
f
ind
_division_by_zero
();
if
(
divide_by_zero
!=
mod
->
end
())
if
(
divide_by_zero
!=
mod
->
end
())
{
{
auto
index
=
std
::
distance
(
mod
->
begin
(),
divide_by_zero
);
auto
index
=
std
::
distance
(
mod
->
begin
(),
divide_by_zero
);
...
...
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