Skip to content

Commit 56865af

Browse files
committed
Fix OpenMP flags
ghstack-source-id: d1f59bb Pull Request resolved: #30
1 parent 3c11c51 commit 56865af

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

setup.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,19 @@
33

44
build_cuda = cpp_extension.CUDA_HOME != None
55

6+
CXX_FLAGS = ['-fopenmp']
7+
NVCC_FLAGS = ['--expt-extended-lambda', '-Xcompiler', '-fopenmp']
8+
69
if build_cuda:
710
csprng_ext = cpp_extension.CUDAExtension(
811
'torch_csprng', ['csprng.cu'],
912
extra_compile_args={'cxx': [],
10-
'nvcc': ['-O2', '--expt-extended-lambda']}
13+
'nvcc': NVCC_FLAGS}
1114
)
1215
else:
1316
csprng_ext = cpp_extension.CppExtension(
14-
'torch_csprng', ['csprng.cpp']
17+
'torch_csprng', ['csprng.cpp'],
18+
extra_compile_args={'cxx': CXX_FLAGS}
1519
)
1620

1721
setup(name='pytorch_csprng',

0 commit comments

Comments
 (0)