-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[opengl] Optimize range_for for ndarrays #3884
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 |
---|---|---|
|
@@ -202,7 +202,7 @@ def init(d: ti.i32, density1: ti.any_arr(), density2: ti.any_arr(), | |
|
||
@ti.test(arch=ti.opengl) | ||
def test_opengl_exceed_max_ssbo(): | ||
# 7 ndarrays + gtmp + args > 8 (maximum allowed) | ||
# 8 ndarrays + args > 8 (maximum allowed) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we really want this test? This seems a bit arch specific & a lot of devices support more There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea this test was mainly a self reminder to double check how many ssbos we create in normal cases - we can remove it later :D |
||
n = 4 | ||
density1 = ti.ndarray(dtype=ti.f32, shape=(n, n)) | ||
density2 = ti.ndarray(dtype=ti.f32, shape=(n, n)) | ||
|
@@ -211,12 +211,13 @@ def test_opengl_exceed_max_ssbo(): | |
density5 = ti.ndarray(dtype=ti.f32, shape=(n, n)) | ||
density6 = ti.ndarray(dtype=ti.f32, shape=(n, n)) | ||
density7 = ti.ndarray(dtype=ti.f32, shape=(n, n)) | ||
density8 = ti.ndarray(dtype=ti.f32, shape=(n, n)) | ||
|
||
@ti.kernel | ||
def init(d: ti.i32, density1: ti.any_arr(), density2: ti.any_arr(), | ||
density3: ti.any_arr(), density4: ti.any_arr(), | ||
density5: ti.any_arr(), density6: ti.any_arr(), | ||
density7: ti.any_arr()): | ||
density7: ti.any_arr(), density8: ti.any_arr()): | ||
for i, j in density1: | ||
density1[i, j] = d + 1 | ||
density2[i, j] = d + 2 | ||
|
@@ -225,10 +226,11 @@ def init(d: ti.i32, density1: ti.any_arr(), density2: ti.any_arr(), | |
density5[i, j] = d + 5 | ||
density6[i, j] = d + 6 | ||
density7[i, j] = d + 7 | ||
density8[i, j] = d + 8 | ||
|
||
with pytest.raises(RuntimeError): | ||
init(0, density1, density2, density3, density4, density5, density6, | ||
density7) | ||
density7, density8) | ||
|
||
|
||
@ti.test(arch=ti.opengl) | ||
|
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.
When we merge this in let's also notify people working on the vulkan ndarray this change