Skip to content

Commit fd71212

Browse files
[mojo-lang] MOCO-3352: Update def to def raises for GPU puzzles (#230)
BEGIN_PUBLIC [mojo-lang] MOCO-3352: Update def to def raises for GPU puzzles END_PUBLIC
1 parent 48db149 commit fd71212

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+100
-100
lines changed

book/src/puzzle_04/intro.mojo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fn kernel[
1717
print(tensor)
1818

1919

20-
def main():
20+
def main() raises:
2121
ctx = DeviceContext()
2222

2323
a = ctx.enqueue_create_buffer[dtype](HEIGHT * WIDTH)

problems/p01/p01.mojo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn add_10(
2121
# ANCHOR_END: add_10
2222

2323

24-
def main():
24+
def main() raises:
2525
with DeviceContext() as ctx:
2626
out = ctx.enqueue_create_buffer[dtype](SIZE)
2727
out.enqueue_fill(0)

problems/p02/p02.mojo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn add(
2222
# ANCHOR_END: add
2323

2424

25-
def main():
25+
def main() raises:
2626
with DeviceContext() as ctx:
2727
out = ctx.enqueue_create_buffer[dtype](SIZE)
2828
out.enqueue_fill(0)

problems/p03/p03.mojo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn add_10_guard(
2222
# ANCHOR_END: add_10_guard
2323

2424

25-
def main():
25+
def main() raises:
2626
with DeviceContext() as ctx:
2727
out = ctx.enqueue_create_buffer[dtype](SIZE)
2828
out.enqueue_fill(0)

problems/p04/p04.mojo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fn add_10_2d(
2323
# ANCHOR_END: add_10_2d
2424

2525

26-
def main():
26+
def main() raises:
2727
with DeviceContext() as ctx:
2828
out = ctx.enqueue_create_buffer[dtype](SIZE * SIZE)
2929
out.enqueue_fill(0)

problems/p04/p04_layout_tensor.mojo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fn add_10_2d(
2424
# ANCHOR_END: add_10_2d_layout_tensor
2525

2626

27-
def main():
27+
def main() raises:
2828
with DeviceContext() as ctx:
2929
out_buf = ctx.enqueue_create_buffer[dtype](SIZE * SIZE)
3030
out_buf.enqueue_fill(0)

problems/p05/p05.mojo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn broadcast_add(
2222

2323

2424
# ANCHOR_END: broadcast_add
25-
def main():
25+
def main() raises:
2626
with DeviceContext() as ctx:
2727
out = ctx.enqueue_create_buffer[dtype](SIZE * SIZE)
2828
out.enqueue_fill(0)

problems/p05/p05_layout_tensor.mojo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fn broadcast_add[
2929

3030

3131
# ANCHOR_END: broadcast_add_layout_tensor
32-
def main():
32+
def main() raises:
3333
with DeviceContext() as ctx:
3434
out_buf = ctx.enqueue_create_buffer[dtype](SIZE * SIZE)
3535
out_buf.enqueue_fill(0)

problems/p06/p06.mojo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn add_10_blocks(
2222
# ANCHOR_END: add_10_blocks
2323

2424

25-
def main():
25+
def main() raises:
2626
with DeviceContext() as ctx:
2727
out = ctx.enqueue_create_buffer[dtype](SIZE)
2828
out.enqueue_fill(0)

problems/p07/p07.mojo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fn add_10_blocks_2d(
2323
# ANCHOR_END: add_10_blocks_2d
2424

2525

26-
def main():
26+
def main() raises:
2727
with DeviceContext() as ctx:
2828
out = ctx.enqueue_create_buffer[dtype](SIZE * SIZE)
2929
out.enqueue_fill(0)

0 commit comments

Comments
 (0)