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

Refactor SDFG List to CFG List #1511

Merged
merged 10 commits into from
Feb 23, 2024
12 changes: 6 additions & 6 deletions dace/codegen/control_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class SingleState(ControlFlow):
def as_cpp(self, codegen, symbols) -> str:
sdfg = self.state.parent

expr = '__state_{}_{}:;\n'.format(sdfg.sdfg_id, self.state.label)
expr = '__state_{}_{}:;\n'.format(sdfg.cfg_id, self.state.label)
if self.state.number_of_nodes() > 0:
expr += '{\n'
expr += self.dispatch_state(self.state)
Expand All @@ -138,7 +138,7 @@ def as_cpp(self, codegen, symbols) -> str:

# If any state has no children, it should jump to the end of the SDFG
if not self.last_state and sdfg.out_degree(self.state) == 0:
expr += 'goto __state_exit_{};\n'.format(sdfg.sdfg_id)
expr += 'goto __state_exit_{};\n'.format(sdfg.cfg_id)
return expr

def generate_transition(self,
Expand Down Expand Up @@ -175,7 +175,7 @@ def generate_transition(self,

if (not edge.data.is_unconditional()
or ((successor is None or edge.dst is not successor) and not assignments_only)):
expr += 'goto __state_{}_{};\n'.format(sdfg.sdfg_id, edge.dst.label)
expr += 'goto __state_{}_{};\n'.format(sdfg.cfg_id, edge.dst.label)

if not edge.data.is_unconditional() and not assignments_only:
expr += '}\n'
Expand Down Expand Up @@ -257,7 +257,7 @@ def as_cpp(self, codegen, symbols) -> str:
# One unconditional edge
if (len(out_edges) == 1 and out_edges[0].data.is_unconditional()):
continue
expr += f'goto __state_exit_{sdfg.sdfg_id};\n'
expr += f'goto __state_exit_{sdfg.cfg_id};\n'

return expr

Expand Down Expand Up @@ -326,7 +326,7 @@ def as_cpp(self, codegen, symbols) -> str:
# execution should end, so we emit an "else goto exit" here.
if len(self.body) > 0:
expr += ' else {\n'
expr += 'goto __state_exit_{};\n'.format(self.sdfg.sdfg_id)
expr += 'goto __state_exit_{};\n'.format(self.sdfg.cfg_id)
if len(self.body) > 0:
expr += '\n}'
return expr
Expand Down Expand Up @@ -475,7 +475,7 @@ def as_cpp(self, codegen, symbols) -> str:
expr += f'case {case}: {{\n'
expr += body.as_cpp(codegen, symbols)
expr += 'break;\n}\n'
expr += f'default: goto __state_exit_{self.sdfg.sdfg_id};'
expr += f'default: goto __state_exit_{self.sdfg.cfg_id};'
expr += '\n}\n'
return expr

Expand Down
4 changes: 2 additions & 2 deletions dace/codegen/instrumentation/data/data_dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
# Create UUID
state_id = sdfg.node_id(state)
node_id = state.node_id(node)
uuid = f'{sdfg.sdfg_id}_{state_id}_{node_id}'
uuid = f'{sdfg.cfg_id}_{state_id}_{node_id}'

Check warning on line 164 in dace/codegen/instrumentation/data/data_dump.py

View check run for this annotation

Codecov / codecov/patch

dace/codegen/instrumentation/data/data_dump.py#L164

Added line #L164 was not covered by tests

# Get optional pre/postamble for instrumenting device data
preamble, postamble = '', ''
Expand Down Expand Up @@ -277,7 +277,7 @@
# Create UUID
state_id = sdfg.node_id(state)
node_id = state.node_id(node)
uuid = f'{sdfg.sdfg_id}_{state_id}_{node_id}'
uuid = f'{sdfg.cfg_id}_{state_id}_{node_id}'

Check warning on line 280 in dace/codegen/instrumentation/data/data_dump.py

View check run for this annotation

Codecov / codecov/patch

dace/codegen/instrumentation/data/data_dump.py#L280

Added line #L280 was not covered by tests

# Get optional pre/postamble for instrumenting device data
preamble, postamble = '', ''
Expand Down
4 changes: 2 additions & 2 deletions dace/codegen/instrumentation/gpu_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ def _report(self, timer_name: str, sdfg=None, state=None, node=None):
int __dace_micros_{id} = (int) (__dace_ms_{id} * 1000.0);
unsigned long int __dace_ts_end_{id} = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::high_resolution_clock::now().time_since_epoch()).count();
unsigned long int __dace_ts_start_{id} = __dace_ts_end_{id} - __dace_micros_{id};
__state->report.add_completion("{timer_name}", "GPU", __dace_ts_start_{id}, __dace_ts_end_{id}, {sdfg_id}, {state_id}, {node_id});'''.format(
__state->report.add_completion("{timer_name}", "GPU", __dace_ts_start_{id}, __dace_ts_end_{id}, {cfg_id}, {state_id}, {node_id});'''.format(
id=idstr,
timer_name=timer_name,
backend=self.backend,
sdfg_id=sdfg.sdfg_id,
cfg_id=sdfg.cfg_id,
state_id=state_id,
node_id=node_id)

Expand Down
52 changes: 26 additions & 26 deletions dace/codegen/instrumentation/likwid.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
'''
local_stream.write(outer_code, sdfg)

for region, sdfg_id, state_id, node_id in self._regions:
for region, cfg_id, state_id, node_id in self._regions:

Check warning on line 172 in dace/codegen/instrumentation/likwid.py

View check run for this annotation

Codecov / codecov/patch

dace/codegen/instrumentation/likwid.py#L172

Added line #L172 was not covered by tests
report_code = f'''
#pragma omp parallel
{{
Expand All @@ -187,7 +187,7 @@

for (int t = 0; t < num_threads; t++)
{{
__state->report.add_completion("Timer", "likwid", 0, time[t] * 1000 * 1000, t, {sdfg_id}, {state_id}, {node_id});
__state->report.add_completion("Timer", "likwid", 0, time[t] * 1000 * 1000, t, {cfg_id}, {state_id}, {node_id});
}}

for (int i = 0; i < nevents; i++)
Expand All @@ -196,7 +196,7 @@

for (int t = 0; t < num_threads; t++)
{{
__state->report.add_counter("{region}", "likwid", event_name, events[t][i], t, {sdfg_id}, {state_id}, {node_id});
__state->report.add_counter("{region}", "likwid", event_name, events[t][i], t, {cfg_id}, {state_id}, {node_id});
}}
}}
}}
Expand All @@ -214,11 +214,11 @@
return

if state.instrument == dace.InstrumentationType.LIKWID_CPU:
sdfg_id = sdfg.sdfg_id
cfg_id = sdfg.cfg_id

Check warning on line 217 in dace/codegen/instrumentation/likwid.py

View check run for this annotation

Codecov / codecov/patch

dace/codegen/instrumentation/likwid.py#L217

Added line #L217 was not covered by tests
state_id = sdfg.node_id(state)
node_id = -1
region = f"state_{sdfg_id}_{state_id}_{node_id}"
self._regions.append((region, sdfg_id, state_id, node_id))
region = f"state_{cfg_id}_{state_id}_{node_id}"
self._regions.append((region, cfg_id, state_id, node_id))

Check warning on line 221 in dace/codegen/instrumentation/likwid.py

View check run for this annotation

Codecov / codecov/patch

dace/codegen/instrumentation/likwid.py#L220-L221

Added lines #L220 - L221 were not covered by tests

marker_code = f'''
#pragma omp parallel
Expand Down Expand Up @@ -250,10 +250,10 @@
return

if state.instrument == dace.InstrumentationType.LIKWID_CPU:
sdfg_id = sdfg.sdfg_id
cfg_id = sdfg.cfg_id

Check warning on line 253 in dace/codegen/instrumentation/likwid.py

View check run for this annotation

Codecov / codecov/patch

dace/codegen/instrumentation/likwid.py#L253

Added line #L253 was not covered by tests
state_id = sdfg.node_id(state)
node_id = -1
region = f"state_{sdfg_id}_{state_id}_{node_id}"
region = f"state_{cfg_id}_{state_id}_{node_id}"

Check warning on line 256 in dace/codegen/instrumentation/likwid.py

View check run for this annotation

Codecov / codecov/patch

dace/codegen/instrumentation/likwid.py#L256

Added line #L256 was not covered by tests

marker_code = f'''
#pragma omp parallel
Expand All @@ -272,12 +272,12 @@
elif node.schedule not in LIKWIDInstrumentationCPU.perf_whitelist_schedules:
raise TypeError("Unsupported schedule on scope")

sdfg_id = sdfg.sdfg_id
cfg_id = sdfg.cfg_id

Check warning on line 275 in dace/codegen/instrumentation/likwid.py

View check run for this annotation

Codecov / codecov/patch

dace/codegen/instrumentation/likwid.py#L275

Added line #L275 was not covered by tests
state_id = sdfg.node_id(state)
node_id = state.node_id(node)
region = f"scope_{sdfg_id}_{state_id}_{node_id}"
region = f"scope_{cfg_id}_{state_id}_{node_id}"

Check warning on line 278 in dace/codegen/instrumentation/likwid.py

View check run for this annotation

Codecov / codecov/patch

dace/codegen/instrumentation/likwid.py#L278

Added line #L278 was not covered by tests

self._regions.append((region, sdfg_id, state_id, node_id))
self._regions.append((region, cfg_id, state_id, node_id))

Check warning on line 280 in dace/codegen/instrumentation/likwid.py

View check run for this annotation

Codecov / codecov/patch

dace/codegen/instrumentation/likwid.py#L280

Added line #L280 was not covered by tests
marker_code = f'''
#pragma omp parallel
{{
Expand All @@ -294,10 +294,10 @@
if not self._likwid_used or entry_node.instrument != dace.InstrumentationType.LIKWID_CPU:
return

sdfg_id = sdfg.sdfg_id
cfg_id = sdfg.cfg_id

Check warning on line 297 in dace/codegen/instrumentation/likwid.py

View check run for this annotation

Codecov / codecov/patch

dace/codegen/instrumentation/likwid.py#L297

Added line #L297 was not covered by tests
state_id = sdfg.node_id(state)
node_id = state.node_id(entry_node)
region = f"scope_{sdfg_id}_{state_id}_{node_id}"
region = f"scope_{cfg_id}_{state_id}_{node_id}"

Check warning on line 300 in dace/codegen/instrumentation/likwid.py

View check run for this annotation

Codecov / codecov/patch

dace/codegen/instrumentation/likwid.py#L300

Added line #L300 was not covered by tests

marker_code = f'''
#pragma omp parallel
Expand Down Expand Up @@ -366,7 +366,7 @@
if not self._likwid_used or sdfg.parent is not None:
return

for region, sdfg_id, state_id, node_id in self._regions:
for region, cfg_id, state_id, node_id in self._regions:

Check warning on line 369 in dace/codegen/instrumentation/likwid.py

View check run for this annotation

Codecov / codecov/patch

dace/codegen/instrumentation/likwid.py#L369

Added line #L369 was not covered by tests
report_code = f'''
{{
double *events = (double*) malloc(MAX_NUM_EVENTS * sizeof(double));
Expand All @@ -377,14 +377,14 @@

LIKWID_NVMARKER_GET("{region}", &ngpus, &nevents, &events, &time, &count);

__state->report.add_completion("Timer", "likwid_gpu", 0, time * 1000 * 1000, 0, {sdfg_id}, {state_id}, {node_id});
__state->report.add_completion("Timer", "likwid_gpu", 0, time * 1000 * 1000, 0, {cfg_id}, {state_id}, {node_id});

int gid = nvmon_getIdOfActiveGroup();
for (int i = 0; i < nevents; i++)
{{
char* event_name = nvmon_getEventName(gid, i);

__state->report.add_counter("{region}", "likwid_gpu", event_name, events[i], 0, {sdfg_id}, {state_id}, {node_id});
__state->report.add_counter("{region}", "likwid_gpu", event_name, events[i], 0, {cfg_id}, {state_id}, {node_id});
}}

free(events);
Expand All @@ -402,11 +402,11 @@
return

if state.instrument == dace.InstrumentationType.LIKWID_GPU:
sdfg_id = sdfg.sdfg_id
cfg_id = sdfg.cfg_id

Check warning on line 405 in dace/codegen/instrumentation/likwid.py

View check run for this annotation

Codecov / codecov/patch

dace/codegen/instrumentation/likwid.py#L405

Added line #L405 was not covered by tests
state_id = sdfg.node_id(state)
node_id = -1
region = f"state_{sdfg_id}_{state_id}_{node_id}"
self._regions.append((region, sdfg_id, state_id, node_id))
region = f"state_{cfg_id}_{state_id}_{node_id}"
self._regions.append((region, cfg_id, state_id, node_id))

Check warning on line 409 in dace/codegen/instrumentation/likwid.py

View check run for this annotation

Codecov / codecov/patch

dace/codegen/instrumentation/likwid.py#L408-L409

Added lines #L408 - L409 were not covered by tests

marker_code = f'''
LIKWID_NVMARKER_REGISTER("{region}");
Expand All @@ -424,10 +424,10 @@
return

if state.instrument == dace.InstrumentationType.LIKWID_GPU:
sdfg_id = sdfg.sdfg_id
cfg_id = sdfg.cfg_id

Check warning on line 427 in dace/codegen/instrumentation/likwid.py

View check run for this annotation

Codecov / codecov/patch

dace/codegen/instrumentation/likwid.py#L427

Added line #L427 was not covered by tests
state_id = sdfg.node_id(state)
node_id = -1
region = f"state_{sdfg_id}_{state_id}_{node_id}"
region = f"state_{cfg_id}_{state_id}_{node_id}"

Check warning on line 430 in dace/codegen/instrumentation/likwid.py

View check run for this annotation

Codecov / codecov/patch

dace/codegen/instrumentation/likwid.py#L430

Added line #L430 was not covered by tests

marker_code = f'''
LIKWID_NVMARKER_STOP("{region}");
Expand All @@ -443,12 +443,12 @@
elif node.schedule not in LIKWIDInstrumentationGPU.perf_whitelist_schedules:
raise TypeError("Unsupported schedule on scope")

sdfg_id = sdfg.sdfg_id
cfg_id = sdfg.cfg_id

Check warning on line 446 in dace/codegen/instrumentation/likwid.py

View check run for this annotation

Codecov / codecov/patch

dace/codegen/instrumentation/likwid.py#L446

Added line #L446 was not covered by tests
state_id = sdfg.node_id(state)
node_id = state.node_id(node)
region = f"scope_{sdfg_id}_{state_id}_{node_id}"
region = f"scope_{cfg_id}_{state_id}_{node_id}"

Check warning on line 449 in dace/codegen/instrumentation/likwid.py

View check run for this annotation

Codecov / codecov/patch

dace/codegen/instrumentation/likwid.py#L449

Added line #L449 was not covered by tests

self._regions.append((region, sdfg_id, state_id, node_id))
self._regions.append((region, cfg_id, state_id, node_id))

Check warning on line 451 in dace/codegen/instrumentation/likwid.py

View check run for this annotation

Codecov / codecov/patch

dace/codegen/instrumentation/likwid.py#L451

Added line #L451 was not covered by tests
marker_code = f'''
LIKWID_NVMARKER_REGISTER("{region}");

Expand All @@ -465,10 +465,10 @@
if not self._likwid_used or entry_node.instrument != dace.InstrumentationType.LIKWID_GPU:
return

sdfg_id = sdfg.sdfg_id
cfg_id = sdfg.cfg_id

Check warning on line 468 in dace/codegen/instrumentation/likwid.py

View check run for this annotation

Codecov / codecov/patch

dace/codegen/instrumentation/likwid.py#L468

Added line #L468 was not covered by tests
state_id = sdfg.node_id(state)
node_id = state.node_id(entry_node)
region = f"scope_{sdfg_id}_{state_id}_{node_id}"
region = f"scope_{cfg_id}_{state_id}_{node_id}"

Check warning on line 471 in dace/codegen/instrumentation/likwid.py

View check run for this annotation

Codecov / codecov/patch

dace/codegen/instrumentation/likwid.py#L471

Added line #L471 was not covered by tests

marker_code = f'''
LIKWID_NVMARKER_STOP("{region}");
Expand Down
2 changes: 1 addition & 1 deletion dace/codegen/instrumentation/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class types, given the currently-registered extensions of this class.

def _idstr(self, sdfg, state, node):
""" Returns a unique identifier string from a node or state. """
result = str(sdfg.sdfg_id)
result = str(sdfg.cfg_id)
if state is not None:
result += '_' + str(sdfg.node_id(state))
if node is not None:
Expand Down
8 changes: 4 additions & 4 deletions dace/codegen/instrumentation/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
def _uuid_to_dict(uuid: UUIDType) -> Dict[str, int]:
result = {}
if uuid[0] != -1:
result['sdfg_id'] = uuid[0]
result['cfg_id'] = uuid[0]
if uuid[1] != -1:
result['state_id'] = uuid[1]
if uuid[2] != -1:
Expand Down Expand Up @@ -83,13 +83,13 @@ def get_event_uuid_and_other_info(event) -> Tuple[UUIDType, Dict[str, Any]]:
other_info = {}
if 'args' in event:
args = event['args']
if 'sdfg_id' in args and args['sdfg_id'] is not None:
uuid = (args['sdfg_id'], -1, -1)
if 'cfg_id' in args and args['cfg_id'] is not None:
uuid = (args['cfg_id'], -1, -1)
if 'state_id' in args and args['state_id'] is not None:
uuid = (uuid[0], args['state_id'], -1)
if 'id' in args and args['id'] is not None:
uuid = (uuid[0], uuid[1], args['id'])
other_info = {k: v for k, v in args.items() if k not in ('sdfg_id', 'state_id', 'id')}
other_info = {k: v for k, v in args.items() if k not in ('cfg_id', 'state_id', 'id')}
return uuid, other_info

def __init__(self, filename: str):
Expand Down
4 changes: 2 additions & 2 deletions dace/codegen/instrumentation/timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def on_tend(self, timer_name: str, stream: CodeIOStream, sdfg=None, state=None,
stream.write('''auto __dace_tend_{id} = std::chrono::high_resolution_clock::now();
unsigned long int __dace_ts_start_{id} = std::chrono::duration_cast<std::chrono::microseconds>(__dace_tbegin_{id}.time_since_epoch()).count();
unsigned long int __dace_ts_end_{id} = std::chrono::duration_cast<std::chrono::microseconds>(__dace_tend_{id}.time_since_epoch()).count();
__state->report.add_completion("{timer_name}", "Timer", __dace_ts_start_{id}, __dace_ts_end_{id}, {sdfg_id}, {state_id}, {node_id});'''
.format(timer_name=timer_name, id=idstr, sdfg_id=sdfg.sdfg_id, state_id=state_id, node_id=node_id))
__state->report.add_completion("{timer_name}", "Timer", __dace_ts_start_{id}, __dace_ts_end_{id}, {cfg_id}, {state_id}, {node_id});'''
.format(timer_name=timer_name, id=idstr, cfg_id=sdfg.cfg_id, state_id=state_id, node_id=node_id))

# Code generation hooks
def on_state_begin(self, sdfg, state, local_stream, global_stream):
Expand Down
2 changes: 1 addition & 1 deletion dace/codegen/prettycode.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def write(self, contents, sdfg=None, state_id=None, node_id=None):

# If SDFG/state/node location is given, annotate this line
if sdfg is not None:
location_identifier = ' ////__DACE:%d' % sdfg.sdfg_id
location_identifier = ' ////__DACE:%d' % sdfg.cfg_id
if state_id is not None:
location_identifier += ':' + str(state_id)
if node_id is not None:
Expand Down
10 changes: 5 additions & 5 deletions dace/codegen/targets/cpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,15 @@
from dace.codegen.targets.cuda import CUDACodeGen # Avoid import loop

if desc.storage == dtypes.StorageType.CPU_ThreadLocal: # Use unambiguous name for thread-local arrays
return f'__{sdfg.sdfg_id}_{name}'
return f'__{sdfg.cfg_id}_{name}'
elif not CUDACodeGen._in_device_code: # GPU kernels cannot access state
return f'__state->__{sdfg.sdfg_id}_{name}'
return f'__state->__{sdfg.cfg_id}_{name}'
elif (sdfg, name) in framecode.where_allocated and framecode.where_allocated[(sdfg, name)] is not sdfg:
return f'__{sdfg.sdfg_id}_{name}'
return f'__{sdfg.cfg_id}_{name}'

Check warning on line 253 in dace/codegen/targets/cpp.py

View check run for this annotation

Codecov / codecov/patch

dace/codegen/targets/cpp.py#L253

Added line #L253 was not covered by tests
elif (desc.transient and sdfg is not None and framecode is not None and (sdfg, name) in framecode.where_allocated
and framecode.where_allocated[(sdfg, name)] is not sdfg):
# Array allocated for another SDFG, use unambiguous name
return f'__{sdfg.sdfg_id}_{name}'
return f'__{sdfg.cfg_id}_{name}'

Check warning on line 257 in dace/codegen/targets/cpp.py

View check run for this annotation

Codecov / codecov/patch

dace/codegen/targets/cpp.py#L257

Added line #L257 was not covered by tests

return name

Expand Down Expand Up @@ -897,7 +897,7 @@
# Doesn't cause crashes due to missing pyMLIR if a MLIR tasklet is not present
from dace.codegen.targets.mlir import utils

mlir_func_uid = "_" + str(sdfg.sdfg_id) + "_" + str(state_id) + "_" + str(dfg.node_id(node))
mlir_func_uid = "_" + str(sdfg.cfg_id) + "_" + str(state_id) + "_" + str(dfg.node_id(node))

Check warning on line 900 in dace/codegen/targets/cpp.py

View check run for this annotation

Codecov / codecov/patch

dace/codegen/targets/cpp.py#L900

Added line #L900 was not covered by tests

mlir_ast = utils.get_ast(node.code.code)
mlir_is_generic = utils.is_generic(mlir_ast)
Expand Down
12 changes: 6 additions & 6 deletions dace/codegen/targets/cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@
shared_data_name = edge.data.data
if not shared_data_name:
# Very unique name. TODO: Make more intuitive
shared_data_name = '__dace_%d_%d_%d_%d_%s' % (sdfg.sdfg_id, state_id, dfg.node_id(node),
shared_data_name = '__dace_%d_%d_%d_%d_%s' % (sdfg.cfg_id, state_id, dfg.node_id(node),
dfg.node_id(dst_node), edge.src_conn)

result.write(
Expand Down Expand Up @@ -1329,7 +1329,7 @@
shared_data_name = edge.data.data
if not shared_data_name:
# Very unique name. TODO: Make more intuitive
shared_data_name = '__dace_%d_%d_%d_%d_%s' % (sdfg.sdfg_id, state_id, dfg.node_id(src_node),
shared_data_name = '__dace_%d_%d_%d_%d_%s' % (sdfg.cfg_id, state_id, dfg.node_id(src_node),
dfg.node_id(node), edge.src_conn)

# Read variable from shared storage
Expand Down Expand Up @@ -1398,7 +1398,7 @@
local_name = edge.data.data
if not local_name:
# Very unique name. TODO: Make more intuitive
local_name = '__dace_%d_%d_%d_%d_%s' % (sdfg.sdfg_id, state_id, dfg.node_id(node),
local_name = '__dace_%d_%d_%d_%d_%s' % (sdfg.cfg_id, state_id, dfg.node_id(node),
dfg.node_id(dst_node), edge.src_conn)

# Allocate variable type
Expand Down Expand Up @@ -1501,7 +1501,7 @@
arguments = []

if state_struct:
toplevel_sdfg: SDFG = sdfg.sdfg_list[0]
toplevel_sdfg: SDFG = sdfg.cfg_list[0]
arguments.append(f'{cpp.mangle_dace_state_struct_name(toplevel_sdfg)} *__state')

# Add "__restrict__" keywords to arguments that do not alias with others in the context of this SDFG
Expand Down Expand Up @@ -1624,7 +1624,7 @@
# If the SDFG has a unique name, use it
sdfg_label = node.unique_name
else:
sdfg_label = "%s_%d_%d_%d" % (node.sdfg.name, sdfg.sdfg_id, state_id, dfg.node_id(node))
sdfg_label = "%s_%d_%d_%d" % (node.sdfg.name, sdfg.cfg_id, state_id, dfg.node_id(node))

code_already_generated = False
if unique_functions and not inline:
Expand Down Expand Up @@ -2015,7 +2015,7 @@
ctype = node.out_connectors[edge.src_conn].ctype
if not local_name:
# Very unique name. TODO: Make more intuitive
local_name = '__dace_%d_%d_%d_%d_%s' % (sdfg.sdfg_id, state_id, dfg.node_id(
local_name = '__dace_%d_%d_%d_%d_%s' % (sdfg.cfg_id, state_id, dfg.node_id(

Check warning on line 2018 in dace/codegen/targets/cpu.py

View check run for this annotation

Codecov / codecov/patch

dace/codegen/targets/cpu.py#L2018

Added line #L2018 was not covered by tests
edge.src), dfg.node_id(edge.dst), edge.src_conn)

# Allocate variable type
Expand Down
Loading
Loading