make code python2/3 compatible

This commit is contained in:
Axel Kohlmeyer
2021-01-16 00:23:44 -05:00
parent efda7559c0
commit a644375afa

View File

@ -1449,16 +1449,16 @@ class lammps(object):
""" """
result = {} result = {}
for p in [b'GPU', b'KOKKOS', b'USER-INTEL', b'USER-OMP']: for p in ['GPU', 'KOKKOS', 'USER-INTEL', 'USER-OMP']:
c = b'api' c = 'api'
result[p.decode()] = {} result[p] = {}
for s in [b'cuda', b'hip', b'pthreads', b'opencl', b'openmp', b'serial']: for s in ['cuda', 'hip', 'pthreads', 'opencl', 'openmp', 'serial']:
if self.lib.lammps_config_accelerator(p,c,s): if self.lib.lammps_config_accelerator(p.encode(),c.encode(),s.encode()):
result[p.decode()][c.decode()] = s.decode() result[p][c] = s
c = b'precision' c = 'precision'
for s in [b'double', b'mixed', b'single']: for s in ['double', 'mixed', 'single']:
if self.lib.lammps_config_accelerator(p,c,s): if self.lib.lammps_config_accelerator(p.encode(),c.encode(),s.encode()):
result[p.decode()][c.decode()] = s.decode() result[p][c] = s
return result return result
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------