diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 35fa46629c91a1f0e29a93a2df5e764cc48a7c8b..69ff3f3c2428e08659f2ca0ef7f936b723711235 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -261,7 +261,8 @@ pycodegen-integration: - cd ../pygrandchem - py.test -v -n $NUM_CORES --junitxml=report.xml . - cd ../walberla/build/ - - make CodegenJacobiCPU CodegenJacobiGPU CodegenPoissonCPU CodegenPoissonGPU MicroBenchmarkGpuLbm LbCodeGenerationExample UniformGridBenchmarkGPU_trt UniformGridBenchmarkGPU_entropic_kbc_n4 FluctuatingMRT + - make -j $NUM_CORES CodegenJacobiCPU CodegenJacobiGPU CodegenPoissonCPU CodegenPoissonGPU MicroBenchmarkGpuLbm LbCodeGenerationExample + - make -j $NUM_CORES multiphaseCPU multiphaseGPU FluctuatingMRT FlowAroundSphereCodeGen - cd apps/benchmarks/UniformGridGPU - make -j $NUM_CORES - cd ../UniformGridGenerated diff --git a/pystencils/kerncraft_coupling/kerncraft_interface.py b/pystencils/kerncraft_coupling/kerncraft_interface.py index 1beb58059feff13ee78d0841641e22cbc5584f29..dd0b0d5c660b8cfecfef623770a8d88505041148 100644 --- a/pystencils/kerncraft_coupling/kerncraft_interface.py +++ b/pystencils/kerncraft_coupling/kerncraft_interface.py @@ -71,7 +71,10 @@ class PyStencilsKerncraftKernel(KernelCode): while cur_node is not None: if isinstance(cur_node, LoopOverCoordinate): loop_counter_sym = cur_node.loop_counter_symbol - loop_info = (loop_counter_sym.name, cur_node.start, cur_node.stop, 1) + loop_info = (loop_counter_sym.name, + sp.Integer(cur_node.start), + sp.Integer(cur_node.stop), + sp.Integer(1)) # If the correct step were to be provided, all access within that step length will # also need to be passed to kerncraft: cur_node.step) self._loop_stack.append(loop_info) diff --git a/pystencils/stencil.py b/pystencils/stencil.py index 3d345990a00a4c329eedbb56e2c9b469a2622d10..48cee7c027019ef251fb7c208081708b5f31b5f1 100644 --- a/pystencils/stencil.py +++ b/pystencils/stencil.py @@ -423,14 +423,14 @@ def plot_3d(stencil, figure=None, axes=None, data=None, textsize='8'): def draw(self, renderer): xs3d, ys3d, zs3d = self._verts3d - xs, ys, zs = proj3d.proj_transform(xs3d, ys3d, zs3d, renderer.M) + xs, ys, zs = proj3d.proj_transform(xs3d, ys3d, zs3d, self.axes.M) self.set_positions((xs[0], ys[0]), (xs[1], ys[1])) FancyArrowPatch.draw(self, renderer) if axes is None: if figure is None: figure = plt.figure() - axes = figure.gca(projection='3d') + axes = figure.add_subplot(projection='3d') try: axes.set_aspect("equal") except NotImplementedError: @@ -446,7 +446,7 @@ def plot_3d(stencil, figure=None, axes=None, data=None, textsize='8'): r = [-1, 1] for s, e in combinations(np.array(list(product(r, r, r))), 2): if np.sum(np.abs(s - e)) == r[1] - r[0]: - axes.plot3D(*zip(s, e), color="k", alpha=0.5) + axes.plot(*zip(s, e), color="k", alpha=0.5) for d, annotation in zip(stencil, data): assert len(d) == 3, "Works only for 3D stencils" diff --git a/pystencils_tests/test_buffer_gpu.py b/pystencils_tests/test_buffer_gpu.py index f63254cd45797f2b2de8b6601fceb23bb0a94d54..2b3f55df59a7b0b1218c41f7cf464e37bb36efbb 100644 --- a/pystencils_tests/test_buffer_gpu.py +++ b/pystencils_tests/test_buffer_gpu.py @@ -38,7 +38,7 @@ def _generate_fields(dt=np.uint8, stencil_directions=1, layout='numpy'): index_dimensions=1 if stencil_directions > 1 else 0).astype(dt).flat gpu_src_arr = gpuarray.to_gpu(src_arr) - gpu_dst_arr = gpuarray.zeros_like(gpu_src_arr) + gpu_dst_arr = gpuarray.empty_like(gpu_src_arr) size = int(np.prod(src_arr.shape)) gpu_buffer_arr = gpuarray.zeros(size, dtype=dt) diff --git a/pystencils_tests/test_random.py b/pystencils_tests/test_random.py index d3686a7320bcbd12aad92e7791c4db48d91a6b78..aa6325961d0c8cfb6dbee893f43a443368501994 100644 --- a/pystencils_tests/test_random.py +++ b/pystencils_tests/test_random.py @@ -78,9 +78,8 @@ def test_rng(target, rng, precision, dtype, t=124, offsets=(0, 0), keys=(0, 0), int_reference = np.empty(dh.shape + (4,), dtype=int) for x in range(dh.shape[0]): for y in range(dh.shape[1]): - r = Philox(counter=t + (x + offset_values[0]) * 2 ** 32 + (y + offset_values[1]) * 2 ** 64, + r = Philox(counter=t + (x + offset_values[0]) * 2 ** 32 + (y + offset_values[1]) * 2 ** 64 - 1, key=keys[0] + keys[1] * 2 ** 32, number=4, width=32, mode="sequence") - r.advance(-4, counter=False) int_reference[x, y, :] = r.random_raw(size=4) if precision == 'float' or dtype == 'float':