Skip to content
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

compiler: Misc code generation improvements #2282

Merged
merged 48 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
bbe3f5d
api: Accept language=sycl (still no-op though)
FabioLuporini Aug 1, 2023
a0af11f
arch: Tweak OneapiCompiler for SYCL
FabioLuporini Aug 1, 2023
96f145d
compiler: Separate out common code in PragmaShmTransformer
FabioLuporini Aug 4, 2023
465fd99
compiler: Add Lambda handler to Uxreplace
FabioLuporini Aug 7, 2023
5e9e8a2
compiler: Fix Definition.expr_symbols
FabioLuporini Aug 8, 2023
89c8514
compiler: Improve Call-Lambda interaction
FabioLuporini Aug 8, 2023
48368e5
compiler: Patch LocalObject.free_symbols
FabioLuporini Aug 8, 2023
7664589
compiler: Patch Definition.functions
FabioLuporini Aug 8, 2023
ecaa2aa
compiler: Fix Call.defines
FabioLuporini Aug 8, 2023
b073fb0
compiler: Add Lambda.{functions,defines}
FabioLuporini Aug 8, 2023
bfd961b
compiler: Support namespaces in the generated code
FabioLuporini Aug 8, 2023
5113b3d
arch: Introduce SyclCompiler
FabioLuporini Nov 22, 2023
1ef8f70
compiler: Fix FindSections for Lambda
FabioLuporini Nov 23, 2023
6b0c1c5
misc: Add docker images for sycl backend
FabioLuporini Nov 23, 2023
be4b1bf
compiler: Add ListMajor
FabioLuporini Nov 24, 2023
e7bf2a1
compiler: Enhance Lambda support
FabioLuporini Nov 24, 2023
6cbdbe9
compiler: Enhance C++ codegen capabilities
FabioLuporini Nov 27, 2023
3bc43ae
compiler: Pump C++ codegen capabilities
FabioLuporini Nov 27, 2023
5842722
compiler: Fix LocalObject codegen
FabioLuporini Nov 29, 2023
b31976c
arch: Fix OneapiCompiler MPI commands
FabioLuporini Nov 29, 2023
efafe51
compiler: Patch CGen._gen_struct_decl to swallow CustomTypes
FabioLuporini Nov 29, 2023
00f8693
compiler: Distinguish between standalones and objs
FabioLuporini Nov 30, 2023
d322cdc
compiler: Fix LocalObject codegen
FabioLuporini Nov 30, 2023
025bac4
compiler: Add LocalObject.modifier
FabioLuporini Nov 30, 2023
c4e1d24
compiler: Improve support for Call via FieldFrom* objs
FabioLuporini Nov 30, 2023
34b16cb
compiler: Allocate Weights array on the stack by default
FabioLuporini Dec 1, 2023
dd349ab
compiler: Optimize weights coefficients at startup
FabioLuporini Dec 1, 2023
7546ac0
arch: Fix OneapiCompiler.MPICC
FabioLuporini Dec 4, 2023
2037fb4
arch: Improve SyclCompiler
FabioLuporini Dec 6, 2023
05bd196
compiler: Patch IntDiv construction
FabioLuporini Dec 6, 2023
5d7d0df
compiler: Add Call.templates
FabioLuporini Dec 7, 2023
ff7e480
compiler: Patch Lambda visitors
FabioLuporini Dec 11, 2023
568cf3e
arch: Set I_MPI_OFFLOAD w/ Intel MPI on GPUs
FabioLuporini Dec 11, 2023
e748bc0
compiler: Fix factorization involving Objects
FabioLuporini Dec 11, 2023
ac7c854
compiler: Enhance LocalObject
FabioLuporini Dec 12, 2023
35f78b7
compiler: Generalize _alloc_mapped_array_on_high_bw_mem
FabioLuporini Dec 13, 2023
0e12b6f
compiler: Tweak orchestration
FabioLuporini Dec 13, 2023
4988492
misc: Rename sycl docker images
FabioLuporini Dec 15, 2023
a72f64a
compiler: Refactor Rvalue
FabioLuporini Dec 15, 2023
b4102d9
arch: Fix OneapiCompiler and SyclCompiler initialization
FabioLuporini Dec 18, 2023
9930c4e
arch: Add INTELGPUMAX
FabioLuporini Dec 19, 2023
e7d5d34
arch: Fix CustomCompiler via Intel toolchain
FabioLuporini Dec 19, 2023
632319c
compiler: Remove unnecessary code
FabioLuporini Dec 19, 2023
762ea3d
misc: Fix docstring
FabioLuporini Dec 19, 2023
796b05f
tests: Use kwargs to make API explicit
FabioLuporini Dec 19, 2023
b815b03
misc: Split Dockerfile.cpu into .cpu and .intel
FabioLuporini Dec 19, 2023
dfd7968
misc: Fix pep8
FabioLuporini Dec 19, 2023
5f63560
docker: update oneapi base drivers
mloubout Dec 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
compiler: Fix LocalObject codegen
  • Loading branch information
FabioLuporini committed Dec 20, 2023
commit 58427223ee856a7c2eebbb82213da853b63cbd70
3 changes: 2 additions & 1 deletion devito/ir/iet/visitors.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ def _gen_value(self, obj, level=2, masked=()):

try:
if obj.cargs:
strobj = MultilineCall(strobj, obj.cargs, True)
arguments = [ccode(i) for i in obj.cargs]
strobj = MultilineCall(strobj, arguments, True)
except AttributeError:
pass

Expand Down
15 changes: 12 additions & 3 deletions tests/test_iet.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from devito.ir import SymbolRegistry
from devito.passes.iet.engine import Graph
from devito.passes.iet.languages.C import CDataManager
from devito.symbolics import Byref, FieldFromComposite, InlineIf, Macro
from devito.symbolics import Byref, FieldFromComposite, InlineIf, Macro, FLOAT
from devito.tools import CustomDtype, as_tuple
from devito.types import Array, LocalObject, Symbol

Expand Down Expand Up @@ -294,11 +294,18 @@ class SpecialObject(LocalObject):

lo2 = SpecialObject('obj2')

# A LocalObject instantiated and subsequently assigned a value
lo3 = MyObject('obj3', initvalue=Macro('meh'))

# A LocalObject instantiated calling its 2-args constructor and subsequently
# assigned a value
lo3 = MyObject('obj3', initvalue=Macro('meh'))
lo4 = MyObject('obj4', cargs=(1, 2), initvalue=Macro('meh'))

# A LocalObject with generic sympy exprs used as constructor args
expr = sympy.Function('ceil')(FLOAT(Symbol(name='s'))**-1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: we might wanna create place holder for all those ceil(type, floor(type .... for cleaner use

lo5 = MyObject('obj5', cargs=(expr,), initvalue=Macro('meh'))

iet = Call('foo', [lo0, lo1, lo2, lo3])
iet = Call('foo', [lo0, lo1, lo2, lo3, lo4, lo5])
iet = ElementalFunction('foo', iet, parameters=())

dm = CDataManager(sregistry=None)
Expand All @@ -308,6 +315,8 @@ class SpecialObject(LocalObject):
assert 'dummy obj1;' not in str(iet)
assert 'bar<int,float>& obj2;' in str(iet)
assert 'dummy obj3 = meh;' in str(iet)
assert 'dummy obj4(1,2) = meh;' in str(iet)
assert 'dummy obj5(ceil(1.0F/(float)s)) = meh;' in str(iet)


def test_call_indexed():
Expand Down