Skip to content

Commit

Permalink
mm target -> matul for consistency, reduce progress report log spammi…
Browse files Browse the repository at this point in the history
…ng of setup.py
  • Loading branch information
austinvhuang committed Jul 19, 2024
1 parent 354e76a commit 1a654f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ run_setup: check-python
all: dawnlib check-clang check-linux-vulkan lib pch
cd examples/gpu_puzzles && make build/gpu_puzzles
cd examples/hello_world && make build/hello_world
cd examples/matmul && make build/mm
cd examples/matmul && make build/matmul
cd examples/physics && make build/physics
cd examples/render && make build/render

Expand Down Expand Up @@ -66,7 +66,7 @@ clean:
read -r -p "This will delete the contents of build/*. Are you sure? [CTRL-C to abort] " response && rm -rf build/*
rm -rf examples/gpu_puzzles/build/*
rm -rf examples/hello_world/build/*
rm -rf examples/matmul/build/mm
rm -rf examples/matmul/build/matmul
rm -rf examples/physics/build/*
rm -rf examples/render/build/*
rm -f build/gpu.h.pch
Expand Down
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,16 @@ def get_os_name():

def download_file(url, output_filename):
total_downloaded = 0
total_truncated = 0 # only print download progress every 2MB to avoid spamming logs

def report_progress(block_num, block_size, total_size):
nonlocal total_downloaded
nonlocal total_truncated
total_downloaded += block_size
print(f"\rDownloaded {total_downloaded // (1024 * 1024)} MB", end="")
if total_downloaded // (1024 * 1024) > total_truncated:
total_truncated = total_downloaded // (1024 * 1024)
if total_truncated % 2 == 0:
print(f"\rDownloaded {total_downloaded // (1024 * 1024)} MB", end="")

try:
ssl._create_default_https_context = ssl._create_stdlib_context
Expand Down

0 comments on commit 1a654f1

Please sign in to comment.