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
OpenDAS
MMCV
Commits
7d075d10
Unverified
Commit
7d075d10
authored
Sep 29, 2022
by
q.yao
Committed by
GitHub
Sep 29, 2022
Browse files
[Fix] Fix MPS ops for torch1.12+ (#2302)
parent
264e170c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
mmcv/ops/csrc/common/mps/MPSLibrary.mm
mmcv/ops/csrc/common/mps/MPSLibrary.mm
+2
-5
No files found.
mmcv/ops/csrc/common/mps/MPSLibrary.mm
View file @
7d075d10
#include "MPSLibrary.h"
#include "MPSLibrary.h"
#include <c10/util/CallOnce.h>
#include "MPSDevice.h"
#include "MPSDevice.h"
static
std
::
unique_ptr
<
MPSLibraryManager
>
mps_library_manager
;
static
std
::
unique_ptr
<
MPSLibraryManager
>
mps_library_manager
=
nullptr
;
static
c10
::
once_flag
mpsdev_init
;
MPSLibraryManager
*
MPSLibraryManager
::
getInstance
()
{
MPSLibraryManager
*
MPSLibraryManager
::
getInstance
()
{
c10
::
call_once
(
mpsdev_init
,
[]
{
if
(
!
mps_library_manager
)
mps_library_manager
=
std
::
unique_ptr
<
MPSLibraryManager
>
(
new
MPSLibraryManager
());
mps_library_manager
=
std
::
unique_ptr
<
MPSLibraryManager
>
(
new
MPSLibraryManager
());
});
return
mps_library_manager
.
get
();
return
mps_library_manager
.
get
();
}
}
...
...
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