Skip to content
Snippets Groups Projects
Commit 26d174f0 authored by Markus Holzer's avatar Markus Holzer
Browse files

Removed OpenCL parallel Datahandling test case

parent f9c36399
No related branches found
No related tags found
1 merge request!36Removed OpenCL parallel Datahandling test case
...@@ -54,24 +54,29 @@ def test_data_handling_2d_opencl(): ...@@ -54,24 +54,29 @@ def test_data_handling_2d_opencl():
pystencils.opencl.opencljit.init_globally() pystencils.opencl.opencljit.init_globally()
print("--- LDC 2D test ---") print("--- LDC 2D test ---")
results = [] results = []
for parallel in [True, False] if parallel_available else [False]:
for gpu in [True, False] if gpu_available else [False]:
if parallel and gpu and not hasattr(wLB, 'cuda'):
continue
print("Testing parallel: %s\tgpu: %s" % (parallel, gpu)) # Since waLBerla has no OpenCL Backend yet, it is not possible to use the
opt_params = {'target': 'opencl' if gpu else 'cpu', # parallel Datahandling with OpenCL at the moment
'gpu_indexing_params': {'block_size': (8, 4, 2)}}
if parallel: # TODO: Activate parallel Datahandling if Backend is available
from pystencils.datahandling import ParallelDataHandling parallel = False
blocks = wLB.createUniformBlockGrid(blocks=(2, 3, 1), cellsPerBlock=(5, 5, 1), for gpu in [True, False] if gpu_available else [False]:
oneBlockPerProcess=False) if parallel and gpu and not hasattr(wLB, 'cuda'):
dh = ParallelDataHandling(blocks, dim=2) continue
rho = ldc_setup(data_handling=dh, optimization=opt_params)
results.append(rho) print("Testing parallel: %s\tgpu: %s" % (parallel, gpu))
else: opt_params = {'target': 'opencl' if gpu else 'cpu',
rho = ldc_setup(domain_size=(10, 15), parallel=False, optimization=opt_params) 'gpu_indexing_params': {'block_size': (8, 4, 2)}}
results.append(rho) 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, optimization=opt_params)
results.append(rho)
else:
rho = ldc_setup(domain_size=(10, 15), parallel=False, optimization=opt_params)
results.append(rho)
for i, arr in enumerate(results[1:]): for i, arr in enumerate(results[1:]):
print("Testing equivalence version 0 with version %d" % (i + 1,)) print("Testing equivalence version 0 with version %d" % (i + 1,))
np.testing.assert_almost_equal(results[0], arr) np.testing.assert_almost_equal(results[0], arr)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment