-
Notifications
You must be signed in to change notification settings - Fork 79
Ruf 069 #982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ruf 069 #982
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1081,7 +1081,7 @@ def test_all_counters_parallel_matmul(): | |||||
| sync_map = lp.get_synchronization_map(knl) | ||||||
| assert len(sync_map) == 2 | ||||||
| assert sync_map.filter_by(kind="kernel_launch").eval_and_sum(params) == 1 | ||||||
| assert sync_map.filter_by(kind="barrier_local").eval_and_sum(params) == 2*m/bsize | ||||||
| assert sync_map.filter_by(kind="barrier_local").eval_and_sum(params) == 2*m/bsize # noqa: RUF069 | ||||||
|
||||||
| assert sync_map.filter_by(kind="barrier_local").eval_and_sum(params) == 2*m/bsize # noqa: RUF069 | |
| assert sync_map.filter_by(kind="barrier_local").eval_and_sum(params) == 2*m//bsize |
Copilot
AI
Feb 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of suppressing RUF069, consider clarifying the division intent. If integer division is intended, use // operator (m*2//bsize*n_subgroups). If float division is intended, consider using a float literal (m*2.0/bsize*n_subgroups) to make the intent explicit.
| assert local_mem_s == m*2/bsize*n_subgroups # noqa: RUF069 | |
| assert local_mem_s == m*2//bsize*n_subgroups |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -223,7 +223,7 @@ def test_tuple(ctx_factory: cl.CtxFactory): | |
| _evt, (a, b) = knl(queue) | ||
|
|
||
| assert a.get() == 1 | ||
| assert b.get() == 2. | ||
| assert b.get() == 2. # noqa: RUF069 | ||
|
||
|
|
||
|
|
||
| def test_clamp(ctx_factory: cl.CtxFactory): | ||
|
|
@@ -334,7 +334,7 @@ def test_pyopencl_execution_numpy_handling(ctx_factory: cl.CtxFactory): | |
| x = np.array([4.]) | ||
| _evt, out = knl(queue, y=y, x=x) | ||
| assert out[0] is x | ||
| assert x[0] == 7. | ||
| assert x[0] == 7. # noqa: RUF069 | ||
|
||
|
|
||
| # test numpy input for x is written to and returned, even when a pyopencl array | ||
| # is passed for y | ||
|
|
@@ -343,7 +343,7 @@ def test_pyopencl_execution_numpy_handling(ctx_factory: cl.CtxFactory): | |
| x = np.array([4.]) | ||
| _evt, out = knl(queue, y=y, x=x) | ||
| assert out[0] is x | ||
| assert x[0] == 7. | ||
| assert x[0] == 7. # noqa: RUF069 | ||
|
||
|
|
||
| # test numpy input for x is written to and returned, even when output-only | ||
| knl = lp.make_kernel("{:}", ["x[0] = y[0] + 2"]) | ||
|
|
@@ -352,7 +352,7 @@ def test_pyopencl_execution_numpy_handling(ctx_factory: cl.CtxFactory): | |
| x = np.array([4.]) | ||
| _evt, out = knl(queue, y=y, x=x) | ||
| assert out[0] is x | ||
| assert x[0] == 5. | ||
| assert x[0] == 5. # noqa: RUF069 | ||
|
||
|
|
||
|
|
||
| def test_opencl_support_for_bool(ctx_factory: cl.CtxFactory): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of suppressing RUF069, consider clarifying the division intent. If integer division is intended, use
//operator (n*(n-1)//2). If float division is intended, consider using a float literal (n*(n-1)/2.0) to make the intent explicit.