|
16 | 16 | from devito.passes.iet.engine import Graph |
17 | 17 | from devito.passes.iet.languages.C import CDataManager |
18 | 18 | from devito.symbolics import (Byref, FieldFromComposite, InlineIf, Macro, Class, |
19 | | - String, FLOAT) |
| 19 | + FLOAT) |
20 | 20 | from devito.tools import CustomDtype, as_tuple, dtype_to_ctype |
21 | | -from devito.types import CustomDimension, Array, LocalObject, Symbol |
| 21 | +from devito.types import CustomDimension, Array, LocalObject, Symbol, Constant |
22 | 22 |
|
23 | 23 |
|
24 | 24 | @pytest.fixture |
@@ -505,16 +505,16 @@ def test_codegen_quality0(): |
505 | 505 | assert foo1.parameters[0] is a |
506 | 506 |
|
507 | 507 |
|
508 | | -# def test_special_array_definition(): |
| 508 | +def test_special_array_definition(): |
509 | 509 |
|
510 | | -# class MyArray(Array): |
511 | | -# is_extern = True |
512 | | -# _data_alignment = False |
| 510 | + class MyArray(Array): |
| 511 | + is_extern = True |
| 512 | + _data_alignment = False |
513 | 513 |
|
514 | | -# dim = CustomDimension(name='d', symbolic_size=String('')) |
515 | | -# a = MyArray(name='a', dimensions=dim, scope='shared', dtype=np.uint8) |
| 514 | + dim = CustomDimension(name='d', symbolic_size=Constant(name='size', value=3.0)) |
| 515 | + a = MyArray(name='a', dimensions=dim, scope='shared', dtype=np.uint8) |
516 | 516 |
|
517 | | -# assert str(Definition(a)) == "extern unsigned char a[];" |
| 517 | + assert str(Definition(a)) == "extern unsigned char a[size];" |
518 | 518 |
|
519 | 519 |
|
520 | 520 | def test_list_inline(): |
|
0 commit comments