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
torch-cluster
Commits
c3026977
"git@developer.sourcefind.cn:OpenDAS/pytorch3d.git" did not exist on "909dc835050f84fc739fe75fd02884f305195afb"
Commit
c3026977
authored
Oct 28, 2020
by
rusty1s
Browse files
conditional OpenMP
parent
d7a16f9a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
csrc/cpu/rw_cpu.cpp
csrc/cpu/rw_cpu.cpp
+1
-1
setup.py
setup.py
+8
-2
No files found.
csrc/cpu/rw_cpu.cpp
View file @
c3026977
#include "rw_cpu.h"
#include "rw_cpu.h"
#include <ATen/Parallel
OpenMP
.h>
#include <ATen/Parallel.h>
#include "utils.h"
#include "utils.h"
...
...
setup.py
View file @
c3026977
...
@@ -4,6 +4,7 @@ import glob
...
@@ -4,6 +4,7 @@ import glob
from
setuptools
import
setup
,
find_packages
from
setuptools
import
setup
,
find_packages
import
torch
import
torch
from
torch.__config__
import
parallel_info
from
torch.utils.cpp_extension
import
BuildExtension
from
torch.utils.cpp_extension
import
BuildExtension
from
torch.utils.cpp_extension
import
CppExtension
,
CUDAExtension
,
CUDA_HOME
from
torch.utils.cpp_extension
import
CppExtension
,
CUDAExtension
,
CUDA_HOME
...
@@ -19,8 +20,13 @@ BUILD_DOCS = os.getenv('BUILD_DOCS', '0') == '1'
...
@@ -19,8 +20,13 @@ BUILD_DOCS = os.getenv('BUILD_DOCS', '0') == '1'
def
get_extensions
():
def
get_extensions
():
Extension
=
CppExtension
Extension
=
CppExtension
define_macros
=
[]
define_macros
=
[]
extra_compile_args
=
{
'cxx'
:
[
'-fopenmp'
]}
extra_compile_args
=
{
'cxx'
:
[]}
extra_link_args
=
[
'-lgomp'
]
extra_link_args
=
[]
info
=
parallel_info
()
if
'parallel backend: OpenMP'
in
info
and
'OpenMP not found'
not
in
info
:
print
(
'Using OpenMP'
)
extra_compile_args
[
'cxx'
]
+=
[
'-DAT_PARALLEL_OPENMP'
,
'-fopenmp'
]
if
WITH_CUDA
:
if
WITH_CUDA
:
Extension
=
CUDAExtension
Extension
=
CUDAExtension
...
...
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