Commit 4709c7d3 authored by Markus Holzer's avatar Markus Holzer
Browse files

Removed old test cases

parent 5a091f03
Pipeline #35838 passed with stages
in 60 minutes and 26 seconds
from hashlib import sha256
from pystencils import Backend, CreateKernelConfig, Target
from lbmpy.creationfunctions import create_lb_ast
from lbmpy.enums import Stencil, Method
from lbmpy.creationfunctions import LBMConfig
from lbmpy.stencils import LBStencil
def test_hash_equivalence_llvm():
import pytest
pytest.importorskip("llvmlite")
from pystencils.llvm.llvmjit import generate_llvm
ref_value = "f1b1879e304fe8533977c885f2744516dd4964064a7e4ae64fd94b8426d995bb"
lbm_config = LBMConfig(stencil=LBStencil(Stencil.D2Q9), method=Method.SRT)
config = CreateKernelConfig(target=Target.CPU, backend=Backend.LLVM)
ast = create_lb_ast(lbm_config=lbm_config, config=config)
code = generate_llvm(ast)
hash_value = sha256(str(code).encode()).hexdigest()
assert hash_value == ref_value
......@@ -50,40 +50,6 @@ def test_data_handling_3d():
np.testing.assert_almost_equal(results[0], arr)
def test_data_handling_2d_opencl():
pytest.importorskip('pyopencl')
import pystencils.opencl.opencljit
pystencils.opencl.opencljit.init_globally()
print("--- LDC 2D test ---")
results = []
# Since waLBerla has no OpenCL Backend yet, it is not possible to use the
# parallel Datahandling with OpenCL at the moment
# TODO: Activate parallel Datahandling if Backend is available
parallel = False
for gpu in [True, False] if gpu_available else [False]:
if parallel and gpu and not hasattr(wLB, 'cuda'):
continue
print(f"Testing parallel: {parallel}\tgpu: {gpu}")
config = CreateKernelConfig(target=Target.GPU if gpu else Target.CPU,
gpu_indexing_params=MappingProxyType({'block_size': (8, 4, 2)}))
if parallel:
from pystencils.datahandling import ParallelDataHandling
blocks = wLB.createUniformBlockGrid(blocks=(2, 3, 1), cellsPerBlock=(5, 5, 1),
oneBlockPerProcess=False)
dh = ParallelDataHandling(blocks, dim=2)
rho = ldc_setup(data_handling=dh, config=config)
results.append(rho)
else:
rho = ldc_setup(domain_size=(10, 15), parallel=False, config=config)
results.append(rho)
for i, arr in enumerate(results[1:]):
print(f"Testing equivalence version 0 with version {i + 1}")
np.testing.assert_almost_equal(results[0], arr)
def test_data_handling_2d():
print("--- LDC 2D test ---")
results = []
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment