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
AutoAWQ
Commits
7fee854f
Commit
7fee854f
authored
Aug 27, 2023
by
Casper
Browse files
Add compute capability flags and n_threads as str
parent
77ca8337
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
setup.py
setup.py
+11
-2
No files found.
setup.py
View file @
7fee854f
...
@@ -35,10 +35,19 @@ if not torch_is_prebuilt:
...
@@ -35,10 +35,19 @@ if not torch_is_prebuilt:
ext_modules
=
[]
ext_modules
=
[]
if
build_cuda_extension
:
if
build_cuda_extension
:
n_threads
=
min
(
os
.
cpu_count
(),
8
)
# figure out compute capability
compute_capabilities
=
{
80
,
86
,
89
,
90
}
if
torch_is_prebuilt
:
compute_capabilities
.
update
({
87
})
capability_flags
=
[
"-gencode"
,
f
"arch=compute_
{
cap
}
,code=sm_
{
cap
}
"
for
cap
in
compute_capabilities
]
# num threads
n_threads
=
str
(
min
(
os
.
cpu_count
(),
8
))
# final args
cxx_args
=
[
"-g"
,
"-O3"
,
"-fopenmp"
,
"-lgomp"
,
"-std=c++17"
]
cxx_args
=
[
"-g"
,
"-O3"
,
"-fopenmp"
,
"-lgomp"
,
"-std=c++17"
]
nvcc_args
=
[
"-O3"
,
"-std=c++17"
,
"--threads"
,
n_threads
]
nvcc_args
=
[
"-O3"
,
"-std=c++17"
,
"--threads"
,
n_threads
]
+
capability_flags
ext_modules
.
append
(
ext_modules
.
append
(
CUDAExtension
(
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