Skip to content

Commit

Permalink
Tidy up the generated kernel source.
Browse files Browse the repository at this point in the history
  • Loading branch information
FreddieWitherden committed Dec 17, 2021
1 parent 20d4334 commit d7f330c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gimmik/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,9 @@ def generate_mm(mat, dtype, platform, alpha=1.0, beta=0.0, funcn='gimmik_mm'):
src = re.sub(r'(?=\d*[.eE])(?=\.?\d)\d*\.?\d*(?:[eE][+-]?\d+)?',
r'\g<0>f', src)

# Cleanup
src = re.sub(r'\n\n+', r'\n\n', src.strip()) + '\n'
src = re.sub(r'\w+$', '', src)

# Return the source
return src

0 comments on commit d7f330c

Please sign in to comment.