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():
pystencils.opencl.opencljit.init_globally()
print("--- LDC 2D test ---")
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))
opt_params = {'target': 'opencl' if gpu else 'cpu',
'gpu_indexing_params': {'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, optimization=opt_params)
results.append(rho)
else:
rho = ldc_setup(domain_size=(10, 15), parallel=False, optimization=opt_params)
results.append(rho)
# 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("Testing parallel: %s\tgpu: %s" % (parallel, gpu))
opt_params = {'target': 'opencl' if gpu else 'cpu',
'gpu_indexing_params': {'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, 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:]):
print("Testing equivalence version 0 with version %d" % (i + 1,))
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