Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
ad5503e
First modifications, no unit test has run yet.
philip-paul-mueller Apr 1, 2026
f322297
Fixed some issues.
philip-paul-mueller Apr 2, 2026
727cfb1
Now also nested SDFGs with external SDFGs can be viewed.
philip-paul-mueller Apr 2, 2026
b292049
Next fixes.
philip-paul-mueller Apr 2, 2026
abee794
Types and python just have zero intersection.
philip-paul-mueller Apr 2, 2026
1613b1c
Okay this was my fault.
philip-paul-mueller Apr 2, 2026
28721e9
This was on me too.
philip-paul-mueller Apr 2, 2026
c0a4639
This is also on me, but this means that somewhere it is actually real…
philip-paul-mueller Apr 2, 2026
d00b4a1
Made some refactoring.
philip-paul-mueller Apr 2, 2026
5f6b054
Small modifications.
philip-paul-mueller Apr 2, 2026
7cdaaea
Removed the no longer needed `get_library_paths()` function.
philip-paul-mueller Apr 2, 2026
563160c
Small modifications.
philip-paul-mueller Apr 2, 2026
f8ce7c3
This was on me.
philip-paul-mueller Apr 2, 2026
2b3bf47
Again on me.
philip-paul-mueller Apr 2, 2026
d4e6017
Added note.
philip-paul-mueller Apr 2, 2026
df384ad
Fixed a logical bug.
philip-paul-mueller Apr 2, 2026
b89c90a
The `return_program_handle` was not respected in some cases.
philip-paul-mueller Apr 2, 2026
16601cd
Added a note about a missing deep copy operation.
philip-paul-mueller Apr 2, 2026
e9f45a7
If the `VERSION` file it is present otherwise the oldstyle full mode …
philip-paul-mueller Apr 2, 2026
3650a42
Bugfix.
philip-paul-mueller Apr 2, 2026
4ca8ec5
Okay this is an error, but the whole thing does not work anyway.
philip-paul-mueller Apr 2, 2026
d3ed2e6
Forgoten argument.
philip-paul-mueller Apr 2, 2026
eb54062
Removed the useless `config` argument.
philip-paul-mueller Apr 2, 2026
926084d
Now the test really test what it is supposed to do, at least accordin…
philip-paul-mueller Apr 2, 2026
64e3569
Free function for getting the version.
philip-paul-mueller Apr 2, 2026
f23ede6
Copy paste is the fruite of sin.
philip-paul-mueller Apr 2, 2026
2b45e61
Added a unit test that is not good but a base to start.
philip-paul-mueller Apr 2, 2026
fd13255
Fixed some bugs in the actuall production logic.
philip-paul-mueller Apr 2, 2026
689b1ab
Moved some code arround.
philip-paul-mueller Apr 2, 2026
37ffbe4
Updated some tests, but there are still some other things that needs …
philip-paul-mueller Apr 2, 2026
5b07332
Version is now estinated from the folder in compilation.
philip-paul-mueller Apr 2, 2026
321de9d
Fixup again.
philip-paul-mueller Apr 2, 2026
5e1694b
Creating a code object no longer implicitly generate the source map.
philip-paul-mueller Apr 7, 2026
1265e7b
Refactored the generation a bit.
philip-paul-mueller Apr 7, 2026
be83dac
Updated the `get_folder_version()` function.
philip-paul-mueller Apr 7, 2026
a7ce8dd
When the SDFG checks if it is loaded it will now also check the folde…
philip-paul-mueller Apr 7, 2026
af95574
Updated some unit tests.
philip-paul-mueller Apr 7, 2026
259b2a4
Conforming to the DaCe unit test format.
philip-paul-mueller Apr 7, 2026
641e079
Added a new test.
philip-paul-mueller Apr 7, 2026
3fa5c5b
Fixed a test.
philip-paul-mueller Apr 7, 2026
218f8db
Refactored the tests a bit.
philip-paul-mueller Apr 7, 2026
d6845c9
Updated some note.
philip-paul-mueller Apr 7, 2026
ad9be45
Renamed `full` to `development`, which I like better.
philip-paul-mueller Apr 17, 2026
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
11 changes: 9 additions & 2 deletions dace/codegen/codeobject.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
import re
import dace
from dace import sourcemap
from dace.properties import (Property, DictProperty, SetProperty, make_properties)

Expand Down Expand Up @@ -45,9 +46,15 @@ def __init__(self,
self.linkable = linkable
self.environments = environments or set()

if language == 'cpp' and title == 'Frame' and sdfg:
sourcemap.create_maps(sdfg, code, self.target.target_name)
# NOTE: In an earlier version, the source maps were generated here. However,
# this had the side effect that the build folder was generated containing
# the source maps, i.e. the `map/` subfolder. However, no code was actually
# dumped to disc. Another effect is that the generation of code would actually
# overwrite the source map, thus it was moved to `generate_program_folder()`.

@property
def clean_code(self):
return re.sub(r'[ \t]*////__(DACE:|CODEGEN;)[^\n]*', '', self.code)

def create_source_map(self, sdfg: 'dace.SDFG') -> None:
sourcemap.create_maps(sdfg, self.code, self.target.target_name)
42 changes: 27 additions & 15 deletions dace/codegen/compiled_sdfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,26 @@ class ReloadableDLL(object):
bypasses Python's dynamic library reloading issues.
"""

def __init__(self, library_filename, program_name):
"""
Creates a new reloadable shared object.
def __init__(self, library_filename, **kwargs):
"""Creates a new reloadable shared object.
The path to the library must be given. The path of the stub library is inferred
from it. This means it is expected that it is located in the same folder,
see `_get_stub_library_path()` for more information.
:param library_filename: Path to library file.
:param program_name: Name of the DaCe program (for use in finding
the stub library loader).
:param libstub_path: Optional path to the stub library.
"""
self._stub_filename = os.path.join(os.path.dirname(os.path.realpath(library_filename)),
f'libdacestub_{program_name}.{Config.get("compiler", "library_extension")}')
self._library_filename = os.path.realpath(library_filename)
from dace.codegen.compiler import _get_stub_library_path

self._library_filename = str(pathlib.Path(library_filename).resolve())

if "libstub_path" in kwargs:
self._stub_filename = str(pathlib.Path(kwargs.pop("libstub_path")).resolve())
else:
self._stub_filename = str(_get_stub_library_path(self._library_filename))
assert len(kwargs) == 0

self._stub = None
self._lib = None

Expand Down Expand Up @@ -478,12 +487,14 @@ def safe_call(self, *args, **kwargs):

# Pickle the SDFG and arguments
with tempfile.NamedTemporaryFile(mode='wb', delete=False) as f:
pickle.dump({
'library_path': self._lib._library_filename,
"sdfg": self.sdfg,
'args': args,
'kwargs': kwargs
}, f)
pickle.dump(
{
'library_path': self._lib._library_filename,
'stublibrary_path': self._lib._stub_filename,
"sdfg": self.sdfg,
'args': args,
'kwargs': kwargs
}, f)
temp_path = f.name

# Call the SDFG in a separate process
Expand All @@ -498,9 +509,10 @@ def safe_call(self, *args, **kwargs):
with open(r"{temp_path}", "rb") as f:
data = pickle.load(f)
library_path = data['library_path']
libstub_path = data['stublibrary_path']
sdfg = data['sdfg']
lib = csd.ReloadableDLL(library_path, sdfg.name)
lib = csd.ReloadableDLL(library_filename=library_path, libstub_path=libstub_path)
obj = csd.CompiledSDFG(sdfg, lib, sdfg.arg_names)
obj(*data['args'], **data['kwargs'])
Expand Down
Loading
Loading