Skip to content

Commit

Permalink
Style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dexter2206 committed Jan 21, 2019
1 parent da1e9d1 commit 2257705
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 29 deletions.
39 changes: 21 additions & 18 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,29 @@
CPP_EXT = '.cpp'

CPU_SEARCH_EXT = Extension('isingcpu',
extra_compile_args=['-fPIC',
'-fopenmp',
'-DTHRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_OMP',
'-lstdc++'],
sources=['./ising/ext_sources/bucketSelectCPU' + CPP_EXT,
'./ising/ext_sources/bucketselectcpu.f90',
'./ising/ext_sources/cpucsort' + CPP_EXT,
'./ising/ext_sources/cpu_thrust_sort.f90',
'./ising/ext_sources/cpusearch.pyf',
'./ising/ext_sources/cpusearch.f90'])
extra_compile_args=[
'-fPIC',
'-fopenmp',
'-DTHRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_OMP',
'-lstdc++'],
sources=[
'./ising/ext_sources/bucketSelectCPU' + CPP_EXT,
'./ising/ext_sources/bucketselectcpu.f90',
'./ising/ext_sources/cpucsort' + CPP_EXT,
'./ising/ext_sources/cpu_thrust_sort.f90',
'./ising/ext_sources/cpusearch.pyf',
'./ising/ext_sources/cpusearch.f90'])

GPU_SEARCH_EXT = Extension('isinggpu',
sources=['./ising/ext_sources/gpusearch.pyf',
'./ising/ext_sources/gpucsort.cu',
'./ising/ext_sources/global.f90',
'./ising/ext_sources/gpu_thrust_sort.f90',
'./ising/ext_sources/bucketSelect.cu',
'./ising/ext_sources/bucketselect.f90',
'./ising/ext_sources/search.f90',
'./ising/ext_sources/gpusearch.f90'],
sources=[
'./ising/ext_sources/gpusearch.pyf',
'./ising/ext_sources/gpucsort.cu',
'./ising/ext_sources/global.f90',
'./ising/ext_sources/gpu_thrust_sort.f90',
'./ising/ext_sources/bucketSelect.cu',
'./ising/ext_sources/bucketselect.f90',
'./ising/ext_sources/search.f90',
'./ising/ext_sources/gpusearch.f90'],
extra_link_args=['-Mcuda'],
extra_f90_compile_args=['-v', '-Mcuda,nordc'])

Expand Down
24 changes: 13 additions & 11 deletions setup_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,20 @@ def customize_compiler_for_nvcc(compiler):
def _compile(obj, src, ext, cc_args, extra_postargs, pp_opts):
if ext == '.cu':
if 'cpu' in os.path.split(src)[1].lower():
postargs = ['-c',
'-O3',
'-Xcompiler',
'-fPIC',
'-Xcompiler',
'-fopenmp',
'-DTHRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_OMP',
'-lstdc++',
'-lcudart']
postargs = [
'-c',
'-O3',
'-Xcompiler',
'-fPIC',
'-Xcompiler',
'-fopenmp',
'-DTHRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_OMP',
'-lstdc++',
'-lcudart']
else:
postargs = ['-Xcompiler',
'-fPIC']
postargs = [
'-Xcompiler',
'-fPIC']

# use the cuda for .cu filese
compiler.set_executable('compiler_so', 'nvcc')
Expand Down

0 comments on commit 2257705

Please sign in to comment.