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
58924228
Commit
58924228
authored
Aug 23, 2023
by
Paul
Browse files
Format
parent
38d3fc69
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
19 deletions
+22
-19
src/targets/gpu/compile_ops.cpp
src/targets/gpu/compile_ops.cpp
+22
-19
No files found.
src/targets/gpu/compile_ops.cpp
View file @
58924228
...
@@ -213,9 +213,10 @@ struct parallel_work
...
@@ -213,9 +213,10 @@ struct parallel_work
std
::
shared_ptr
<
std
::
mutex
>
m
=
std
::
make_shared
<
std
::
mutex
>
();
std
::
shared_ptr
<
std
::
mutex
>
m
=
std
::
make_shared
<
std
::
mutex
>
();
// parallel_work(parallel_work&&) noexcept = default;
// parallel_work(parallel_work&&) noexcept = default;
optional
<
std
::
size_t
>
pop
()
{
optional
<
std
::
size_t
>
pop
()
{
std
::
lock_guard
<
std
::
mutex
>
guard
(
*
m
);
std
::
lock_guard
<
std
::
mutex
>
guard
(
*
m
);
if
(
stop
>=
start
)
if
(
stop
>=
start
)
return
nullopt
;
return
nullopt
;
return
start
++
;
return
start
++
;
}
}
...
@@ -244,15 +245,17 @@ void par_compile(std::size_t n, F f)
...
@@ -244,15 +245,17 @@ void par_compile(std::size_t n, F f)
f
(
*
w
);
f
(
*
w
);
while
(
any_of
(
range
(
d
),
[
&
](
auto
j
)
{
while
(
any_of
(
range
(
d
),
[
&
](
auto
j
)
{
auto
k
=
(
j
+
i
+
1
)
%
d
;
auto
k
=
(
j
+
i
+
1
)
%
d
;
if
(
k
==
i
)
if
(
k
==
i
)
return
false
;
return
false
;
auto
w
=
pw
[
k
].
pop
();
auto
w
=
pw
[
k
].
pop
();
if
(
w
.
has_value
())
{
if
(
w
.
has_value
())
{
std
::
cout
<<
"Steal"
<<
std
::
endl
;
std
::
cout
<<
"Steal"
<<
std
::
endl
;
f
(
*
w
);
f
(
*
w
);
}
}
return
w
.
has_value
();
return
w
.
has_value
();
}));
}))
;
});
});
}
}
...
...
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