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
jerrrrry
infinicore
Commits
b3170335
Unverified
Commit
b3170335
authored
Aug 29, 2025
by
PanZezhong1725
Committed by
GitHub
Aug 29, 2025
Browse files
issue/411: adjust mudnn handle use to prevent mudnn handle mismatching
parents
1d064392
f34d4e3b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
src/infiniop/devices/moore/moore_common.h
src/infiniop/devices/moore/moore_common.h
+3
-1
src/infiniop/devices/moore/moore_handle.cc
src/infiniop/devices/moore/moore_handle.cc
+3
-2
No files found.
src/infiniop/devices/moore/moore_common.h
View file @
b3170335
...
@@ -21,11 +21,13 @@ class Handle::Internal {
...
@@ -21,11 +21,13 @@ class Handle::Internal {
_block_size
[
3
],
_block_size
[
3
],
_grid_size
[
3
];
_grid_size
[
3
];
int
_device_id
;
template
<
typename
T
>
template
<
typename
T
>
using
Fn
=
std
::
function
<
infiniStatus_t
(
T
)
>
;
using
Fn
=
std
::
function
<
infiniStatus_t
(
T
)
>
;
public:
public:
Internal
(
int
);
Internal
(
int
device_id
);
infiniStatus_t
useMublas
(
musaStream_t
stream
,
const
Fn
<
mublasHandle_t
>
&
f
)
const
;
infiniStatus_t
useMublas
(
musaStream_t
stream
,
const
Fn
<
mublasHandle_t
>
&
f
)
const
;
infiniStatus_t
useMudnn
(
musaStream_t
stream
,
const
Fn
<::
musa
::
dnn
::
Handle
&>
&
f
)
const
;
infiniStatus_t
useMudnn
(
musaStream_t
stream
,
const
Fn
<::
musa
::
dnn
::
Handle
&>
&
f
)
const
;
...
...
src/infiniop/devices/moore/moore_handle.cc
View file @
b3170335
...
@@ -11,7 +11,8 @@ auto Handle::internal() const -> const std::shared_ptr<Internal> & {
...
@@ -11,7 +11,8 @@ auto Handle::internal() const -> const std::shared_ptr<Internal> & {
return
_internal
;
return
_internal
;
}
}
Handle
::
Internal
::
Internal
(
int
device_id
)
{
Handle
::
Internal
::
Internal
(
int
device_id
)
:
_device_id
(
device_id
)
{
musaDeviceProp
prop
;
musaDeviceProp
prop
;
musaGetDeviceProperties
(
&
prop
,
device_id
);
musaGetDeviceProperties
(
&
prop
,
device_id
);
_warp_size
=
prop
.
warpSize
;
_warp_size
=
prop
.
warpSize
;
...
@@ -45,7 +46,7 @@ infiniStatus_t Handle::Internal::useMudnn(musaStream_t stream, const Fn<::musa::
...
@@ -45,7 +46,7 @@ infiniStatus_t Handle::Internal::useMudnn(musaStream_t stream, const Fn<::musa::
if
(
opt_handle
.
has_value
())
{
if
(
opt_handle
.
has_value
())
{
handle
=
std
::
move
(
*
opt_handle
);
handle
=
std
::
move
(
*
opt_handle
);
}
else
{
}
else
{
handle
=
std
::
make_unique
<::
musa
::
dnn
::
Handle
>
();
handle
=
std
::
make_unique
<::
musa
::
dnn
::
Handle
>
(
_device_id
);
}
}
CHECK_MUDNN
(
handle
->
SetStream
(
stream
));
CHECK_MUDNN
(
handle
->
SetStream
(
stream
));
CHECK_STATUS
(
f
(
*
handle
));
CHECK_STATUS
(
f
(
*
handle
));
...
...
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