Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test] Expand the tolerance for testing on metal backend #1779

Merged
merged 1 commit into from
Aug 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions python/taichi/testing.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import taichi as ti


## Helper functions
# Helper functions
def approx(expected, **kwargs):
'''Tweaked pytest.approx for OpenGL low percisions'''
import pytest
Expand All @@ -22,6 +22,9 @@ def __ne__(self, other):
if ti.cfg.arch == ti.opengl:
kwargs['rel'] = max(kwargs.get('rel', 1e-6), 1e-3)

if ti.cfg.arch == ti.metal:
kwargs['rel'] = max(kwargs.get('rel', 1e-6), 1e-4)

return pytest.approx(expected, **kwargs)


Expand All @@ -39,7 +42,7 @@ def make_temp_file(*args, **kwargs):
return name


## Pytest options
# Pytest options
def _get_taichi_archs_fixture():
import pytest

Expand Down