Skip to content

Commit

Permalink
Merge pull request #35 from barbagroup/update_cuda
Browse files Browse the repository at this point in the history
Update cuda
  • Loading branch information
cdcooper84 committed Jan 17, 2017
2 parents f7c4937 + 5b34c7b commit ae54c24
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 29 deletions.
13 changes: 0 additions & 13 deletions pygbe/main.py
Expand Up @@ -167,7 +167,6 @@ def check_for_nvcc():
"""Check system PATH for nvcc, exit if not found"""
try:
subprocess.check_output(['which', 'nvcc'])
check_nvcc_version()
return True
except subprocess.CalledProcessError:
print(
Expand All @@ -176,18 +175,6 @@ def check_for_nvcc():
return False


def check_nvcc_version():
"""Check that version of nvcc <= 7.5"""
verstr = subprocess.check_output(['nvcc', '--version']).decode('utf-8')
cuda_ver = re.compile('release (\d\.\d)')
match = re.search(cuda_ver, verstr)
version = float(match.group(1))
if version > 7.5:
sys.exit('PyGBe only supports CUDA <= 7.5\n'
'Please install an earlier version of the CUDA toolkit\n'
'or remove `nvcc` from your PATH to use CPU only.')


def main(argv=sys.argv, log_output=True, return_output_fname=False,
return_results_dict=False, field=None):
"""
Expand Down
5 changes: 1 addition & 4 deletions tests/test_lysozyme.py
Expand Up @@ -25,10 +25,7 @@ def test_lysozyme(key):
with open('lysozyme.pickle', 'rb') as f:
base_results = pickle.load(f)

if base_results[key] > 0:
assert abs(base_results[key] - results[key]) / base_results[key] < 1e-12
else:
assert base_results[key] == results[key]
assert abs(base_results[key] - results[key]) / abs(base_results[key]) < 1e-12

def test_lysozyme_iterations():
results = get_results()
Expand Down
5 changes: 1 addition & 4 deletions tests/test_pgbmut.py
Expand Up @@ -25,10 +25,7 @@ def test_PGB_mut_sensor(key):
with open('pgbmut.pickle', 'rb') as f:
base_results = pickle.load(f)

if base_results[key] > 0:
assert abs(base_results[key] - results[key]) / base_results[key] < 1e-12
else:
assert base_results[key] == results[key]
assert abs(base_results[key] - results[key]) / abs(base_results[key]) < 1e-12

def test_pgbmut_iterations():
results = get_results()
Expand Down
5 changes: 1 addition & 4 deletions tests/test_sphere.py
Expand Up @@ -25,10 +25,7 @@ def test_sphere(key):
with open('sphere.pickle', 'rb') as f:
base_results = pickle.load(f)

if base_results[key] > 0:
assert abs(base_results[key] - results[key]) / base_results[key] < 1e-12
else:
assert base_results[key] == results[key]
assert abs(base_results[key] - results[key]) / abs(base_results[key] + 1e-16) < 1e-12

def test_sphere_iterations():
results = get_results()
Expand Down
5 changes: 1 addition & 4 deletions tests/test_two_spheres.py
Expand Up @@ -25,10 +25,7 @@ def test_two_sphere(key):
with open('two_sphere.pickle', 'rb') as f:
base_results = pickle.load(f)

if base_results[key] > 0:
assert abs(base_results[key] - results[key]) / base_results[key] < 1e-12
else:
assert base_results[key] == results[key]
assert abs(base_results[key] - results[key]) / (abs(base_results[key]) + 1e-16) < 1e-12

def test_two_sphere_iterations():
results = get_results()
Expand Down

0 comments on commit ae54c24

Please sign in to comment.