Skip to content

Commit

Permalink
Merge pull request #54 from HERA-Team/fix-block-size
Browse files Browse the repository at this point in the history
fix: better block/grid size determination
  • Loading branch information
steven-murray authored May 9, 2023
2 parents f2c8094 + e4c5105 commit 403d1c7
Show file tree
Hide file tree
Showing 11 changed files with 328 additions and 207 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/publish-to-pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: push
jobs:
build-n-publish:
name: Deploy
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
# https://github.com/ansible/pylibssh/blob/1e7b17f/.github/workflows/build-test-n-publish.yml#L146-L151
Expand All @@ -23,7 +23,6 @@ jobs:
run: |
python -m pip install build
python -m pip install setuptools_scm setuptools>42
python setup.py --version
- name: Create setuptools_scm env variable
if: startsWith(github.ref, 'refs/tags/') != true
shell: bash
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@ docs/_autosummary/*
full-stats-*.txt
stats-*.pkl
summary-stats-*.pkl
.hypothesis/*
Binary file added gpu-analysis.nvprof
Binary file not shown.
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ profile =
line-profiler
pyuvsim>=1.2.5
test =
hypothesis
ipython
matplotlib
pyradiosky
Expand Down Expand Up @@ -109,6 +110,7 @@ ignore =
per-file-ignores =
src/vis_cpu/cli.py: T201,T001
tests/*.py: T201,T001,E402
setup.py: D100
max-line-length = 88
max-complexity = 25
rst-roles =
Expand Down
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from setuptools import setup

setup()
8 changes: 8 additions & 0 deletions src/vis_cpu/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ def no_op(fnc):
return fnc


def ceildiv(a: int, b: int) -> int:
"""Ceiling division for integers.
From https://stackoverflow.com/a/17511341/1467820
"""
return -(a // -b)


def human_readable_size(size, decimal_places=2, indicate_sign=False):
"""Get a human-readable data size.
Expand Down
2 changes: 1 addition & 1 deletion src/vis_cpu/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def get_summary_stats(line_data, total_time, ids):
if not assoc_lines:
raise RuntimeError(
f"Could not find any lines for {thing} satisfying '{lines}'. "
f"Possible lines: {' | '.join(list(line_data.keys()))}"
"Possible lines:\n" + "\n".join(list(line_data.keys()))
)

# save (hits, time, time/hits, percent, nlines)
Expand Down
Loading

0 comments on commit 403d1c7

Please sign in to comment.