Skip to content

Commit ae3a0e7

Browse files
committed
style: clean up code formatting and remove unnecessary blank lines in assembler.py; adjust comments in gpu.py for clarity
1 parent aa76eb1 commit ae3a0e7

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/tinygpu/assembler.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
def _strip_and_remove_comment(line):
32
line = line.strip()
43
if not line:
@@ -7,6 +6,7 @@ def _strip_and_remove_comment(line):
76
line = line.split(";", 1)[0].strip()
87
return line
98

9+
1010
def _collect_labels(lines):
1111
labels = {}
1212
pc = 0
@@ -21,6 +21,7 @@ def _collect_labels(lines):
2121
pc += 1
2222
return labels
2323

24+
2425
def _parse_args(parts, labels):
2526
args = []
2627
for token in parts[1:]:
@@ -32,6 +33,7 @@ def _parse_args(parts, labels):
3233
args.append(labels.get(token, token))
3334
return args
3435

36+
3537
def assemble_file(path):
3638
"""
3739
Assembles .tgpu file with label support.

src/tinygpu/gpu.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ def _record_state(self):
114114
# increment to next instruction
115115
self.pc[tid] = before_pc + 1
116116

117-
# handle global barrier:
118-
# if any thread is waiting at a sync point, check if we can release
117+
# handle global barrier:
118+
# if any thread is waiting at a sync point, check if we can release
119119
if self.sync_waiting.any():
120120
# crude policy: release when all active threads have sync_waiting True
121121
# only consider threads that are still active

0 commit comments

Comments
 (0)