|
4 | 4 | from tests import test_utils
|
5 | 5 |
|
6 | 6 |
|
7 |
| -@test_utils.test(arch=[ti.opengl, ti.cc]) |
| 7 | +@test_utils.test(arch=[ti.cc]) |
8 | 8 | def test_exceed_max_eight():
|
9 | 9 | @ti.kernel
|
10 | 10 | def foo1(a: ti.i32, b: ti.i32, c: ti.i32, d: ti.i32, e: ti.i32, f: ti.i32,
|
@@ -181,3 +181,54 @@ def duplicate():
|
181 | 181 | with pytest.raises(ti.TaichiSyntaxError,
|
182 | 182 | match="Multiple values for argument 'a'"):
|
183 | 183 | duplicate()
|
| 184 | + |
| 185 | + |
| 186 | +@test_utils.test(exclude=[ti.cc]) |
| 187 | +def test_args_with_many_ndarrays(): |
| 188 | + |
| 189 | + particle_num = 0 |
| 190 | + cluster_num = 0 |
| 191 | + permu_num = 0 |
| 192 | + |
| 193 | + particlePosition = ti.Vector.ndarray(3, ti.f32, shape=10) |
| 194 | + outClusterPosition = ti.Vector.ndarray(3, ti.f32, shape=10) |
| 195 | + outClusterOffsets = ti.ndarray(ti.i32, shape=10) |
| 196 | + outClusterSizes = ti.ndarray(ti.i32, shape=10) |
| 197 | + outClusterIndices = ti.ndarray(ti.i32, shape=10) |
| 198 | + |
| 199 | + particle_pos = ti.Vector.ndarray(3, ti.f32, shape=20) |
| 200 | + particle_prev_pos = ti.Vector.ndarray(3, ti.f32, shape=20) |
| 201 | + particle_rest_pos = ti.Vector.ndarray(3, ti.f32, shape=20) |
| 202 | + particle_index = ti.ndarray(ti.i32, shape=20) |
| 203 | + |
| 204 | + cluster_rest_mass_center = ti.Vector.ndarray(3, ti.f32, shape=20) |
| 205 | + cluster_begin = ti.ndarray(ti.i32, shape=20) |
| 206 | + |
| 207 | + @ti.kernel |
| 208 | + def ti_import_cluster_data( |
| 209 | + center: ti.types.vector(3, |
| 210 | + ti.f32), particle_num: int, cluster_num: int, |
| 211 | + permu_num: int, particlePosition: ti.types.ndarray(field_dim=1), |
| 212 | + outClusterPosition: ti.types.ndarray(field_dim=1), |
| 213 | + outClusterOffsets: ti.types.ndarray(field_dim=1), |
| 214 | + outClusterSizes: ti.types.ndarray(field_dim=1), |
| 215 | + outClusterIndices: ti.types.ndarray(field_dim=1), |
| 216 | + particle_pos: ti.types.ndarray(field_dim=1), |
| 217 | + particle_prev_pos: ti.types.ndarray(field_dim=1), |
| 218 | + particle_rest_pos: ti.types.ndarray(field_dim=1), |
| 219 | + cluster_rest_mass_center: ti.types.ndarray(field_dim=1), |
| 220 | + cluster_begin: ti.types.ndarray(field_dim=1), |
| 221 | + particle_index: ti.types.ndarray(field_dim=1)): |
| 222 | + |
| 223 | + added_permu_num = outClusterIndices.shape[0] |
| 224 | + |
| 225 | + for i in range(added_permu_num): |
| 226 | + particle_index[i] = 1.0 |
| 227 | + |
| 228 | + center = ti.math.vec3(0, 0, 0) |
| 229 | + ti_import_cluster_data(center, particle_num, cluster_num, permu_num, |
| 230 | + particlePosition, outClusterPosition, |
| 231 | + outClusterOffsets, outClusterSizes, |
| 232 | + outClusterIndices, particle_pos, particle_prev_pos, |
| 233 | + particle_rest_pos, cluster_rest_mass_center, |
| 234 | + cluster_begin, particle_index) |
0 commit comments