Skip to content
Snippets Groups Projects

Various GPU-related and some general fixes.

  • Recombine KernelWrapper APIs of CPU and GPU JIT
  • Clean up JIT module
  • Fix kernel constraints analysis
  • Fix handling of slices with negative start index
  • Fix sparse iteration spaces on GPUs
  • Reintroduce GPU periodicity module
  • Extend GPU test cases
  • Reintroduce kwargs for create_kernel
  • Restrict parsing of structured data types to aligned types
  • Expose GPU block size selection through CreateKernelConfig
Edited by Frederik Hennig

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Michael Zikeli
  • 1 import numpy as np
    2 from itertools import product
    3
    4 from pystencils import CreateKernelConfig, create_kernel
    5 from pystencils import Assignment, Field
    6 from pystencils.enums import Target
    7 from pystencils.slicing import get_periodic_boundary_src_dst_slices, normalize_slice
    8
    9
    10 def create_copy_kernel(domain_size, from_slice, to_slice, index_dimensions=0, index_dim_shape=1, dtype=np.float64):
  • Michael Zikeli
  • added 1 commit

    • db0670d1 - Fix naming in GPU periodicity module; remove copy of the module in `old` folder

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • Michael Zikeli
  • added 1 commit

    Compare with previous version

  • 12 src_slice,
    13 dst_slice,
    14 index_dimensions=0,
    15 index_dim_shape=1,
    16 dtype=np.float64,
    17 ):
    11 18 """Copies a rectangular part of an array to another non-overlapping part"""
    12 19
    13 f = Field.create_generic("pdfs", len(domain_size), index_dimensions=index_dimensions, dtype=dtype)
    14 normalized_from_slice = normalize_slice(from_slice, f.spatial_shape)
    15 normalized_to_slice = normalize_slice(to_slice, f.spatial_shape)
    20 field = Field.create_generic(
    21 "field", len(domain_size), index_dimensions=index_dimensions, dtype=dtype
    22 )
    23 normalized_from_slice = normalize_slice(src_slice, field.spatial_shape)
    24 normalized_to_slice = normalize_slice(dst_slice, field.spatial_shape)
  • 20 field = Field.create_generic(
    21 "field", len(domain_size), index_dimensions=index_dimensions, dtype=dtype
    22 )
    23 normalized_from_slice = normalize_slice(src_slice, field.spatial_shape)
    24 normalized_to_slice = normalize_slice(dst_slice, field.spatial_shape)
    16 25
    17 offset = [s1.start - s2.start for s1, s2 in zip(normalized_from_slice, normalized_to_slice)]
    18 assert offset == [s1.stop - s2.stop for s1, s2 in zip(normalized_from_slice, normalized_to_slice)], \
    19 "Slices have to have same size"
    26 offset = [
    27 s1.start - s2.start
    28 for s1, s2 in zip(normalized_from_slice, normalized_to_slice)
    29 ]
    30 assert offset == [
    31 s1.stop - s2.stop for s1, s2 in zip(normalized_from_slice, normalized_to_slice)
    32 ], "Slices have to have same size"
    • Comment on lines +26 to +32
      Suggested change
      26 offset = [
      27 s1.start - s2.start
      28 for s1, s2 in zip(normalized_from_slice, normalized_to_slice)
      29 ]
      30 assert offset == [
      31 s1.stop - s2.stop for s1, s2 in zip(normalized_from_slice, normalized_to_slice)
      32 ], "Slices have to have same size"
      26 offset = [
      27 s1.start - s2.start
      28 for s1, s2 in zip(normalized_src_slice, normalized_dst_slice)
      29 ]
      30 assert offset == [
      31 s1.stop - s2.stop for s1, s2 in zip(normalized_src_slice, normalized_dst_slice)
      32 ], "Slices have to have same size"
    • Please register or sign in to reply
  • Michael Zikeli
  • Michael Zikeli approved this merge request

    approved this merge request

  • added 1 commit

    • 91c47eea - Clarify normalization of slices

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • Michael Zikeli mentioned in commit a03acd9a

    mentioned in commit a03acd9a

  • Michael Zikeli mentioned in issue #93

    mentioned in issue #93

  • Please register or sign in to reply
    Loading