dace package
Subpackages
- dace.codegen package
- Subpackages
- dace.codegen.instrumentation package
- Submodules
- dace.codegen.instrumentation.fpga module
- dace.codegen.instrumentation.gpu_events module
- dace.codegen.instrumentation.papi module
PAPIInstrumentationPAPIInstrumentation.configure_papi()PAPIInstrumentation.get_unique_number()PAPIInstrumentation.has_surrounding_perfcounters()PAPIInstrumentation.on_consume_entry()PAPIInstrumentation.on_copy_begin()PAPIInstrumentation.on_copy_end()PAPIInstrumentation.on_map_entry()PAPIInstrumentation.on_node_begin()PAPIInstrumentation.on_node_end()PAPIInstrumentation.on_scope_entry()PAPIInstrumentation.on_scope_exit()PAPIInstrumentation.on_sdfg_begin()PAPIInstrumentation.on_sdfg_end()PAPIInstrumentation.on_state_begin()PAPIInstrumentation.perf_counter_end_measurement_string()PAPIInstrumentation.perf_counter_start_measurement_string()PAPIInstrumentation.perf_counter_string()PAPIInstrumentation.perf_counter_string_from_string_list()PAPIInstrumentation.perf_get_supersection_start_string()PAPIInstrumentation.perf_section_start_string()PAPIInstrumentation.perf_supersection_start_string()PAPIInstrumentation.perf_whitelist_schedulesPAPIInstrumentation.should_instrument_entry()
PAPIUtilsPAPIUtils.accumulate_byte_movement()PAPIUtils.all_maps()PAPIUtils.available_counters()PAPIUtils.get_iteration_count()PAPIUtils.get_memlet_byte_size()PAPIUtils.get_memory_input_size()PAPIUtils.get_out_memlet_costs()PAPIUtils.get_parents()PAPIUtils.get_tasklet_byte_accesses()PAPIUtils.is_papi_used()PAPIUtils.reduce_iteration_count()
- dace.codegen.instrumentation.provider module
InstrumentationProviderInstrumentationProvider.extensions()InstrumentationProvider.get_provider_mapping()InstrumentationProvider.on_copy_begin()InstrumentationProvider.on_copy_end()InstrumentationProvider.on_node_begin()InstrumentationProvider.on_node_end()InstrumentationProvider.on_scope_entry()InstrumentationProvider.on_scope_exit()InstrumentationProvider.on_sdfg_begin()InstrumentationProvider.on_sdfg_end()InstrumentationProvider.on_state_begin()InstrumentationProvider.on_state_end()InstrumentationProvider.register()InstrumentationProvider.unregister()
- dace.codegen.instrumentation.report module
- dace.codegen.instrumentation.timer module
- dace.codegen.instrumentation.data module
- Module contents
- dace.codegen.targets package
- Submodules
- dace.codegen.targets.cpu module
CPUCodeGenCPUCodeGen.allocate_array()CPUCodeGen.allocate_reference()CPUCodeGen.allocate_view()CPUCodeGen.cmake_options()CPUCodeGen.copy_memory()CPUCodeGen.deallocate_array()CPUCodeGen.declare_array()CPUCodeGen.define_out_memlet()CPUCodeGen.generate_node()CPUCodeGen.generate_nsdfg_arguments()CPUCodeGen.generate_nsdfg_call()CPUCodeGen.generate_nsdfg_header()CPUCodeGen.generate_scope()CPUCodeGen.generate_scope_postamble()CPUCodeGen.generate_scope_preamble()CPUCodeGen.generate_tasklet_postamble()CPUCodeGen.generate_tasklet_preamble()CPUCodeGen.get_generated_codeobjects()CPUCodeGen.has_finalizerCPUCodeGen.has_initializerCPUCodeGen.languageCPUCodeGen.make_ptr_assignment()CPUCodeGen.make_ptr_vector_cast()CPUCodeGen.memlet_ctor()CPUCodeGen.memlet_definition()CPUCodeGen.memlet_stream_ctor()CPUCodeGen.memlet_view_ctor()CPUCodeGen.process_out_memlets()CPUCodeGen.target_nameCPUCodeGen.titleCPUCodeGen.unparse_tasklet()CPUCodeGen.write_and_resolve_expr()
- dace.codegen.targets.cuda module
CUDACodeGenCUDACodeGen.allocate_array()CUDACodeGen.allocate_stream()CUDACodeGen.cmake_options()CUDACodeGen.copy_memory()CUDACodeGen.deallocate_array()CUDACodeGen.deallocate_stream()CUDACodeGen.declare_array()CUDACodeGen.define_out_memlet()CUDACodeGen.generate_devicelevel_scope()CUDACodeGen.generate_devicelevel_state()CUDACodeGen.generate_kernel_scope()CUDACodeGen.generate_node()CUDACodeGen.generate_nsdfg_arguments()CUDACodeGen.generate_nsdfg_call()CUDACodeGen.generate_nsdfg_header()CUDACodeGen.generate_scope()CUDACodeGen.generate_state()CUDACodeGen.get_generated_codeobjects()CUDACodeGen.get_kernel_dimensions()CUDACodeGen.get_next_scope_entries()CUDACodeGen.get_tb_maps_recursive()CUDACodeGen.has_finalizerCUDACodeGen.has_initializerCUDACodeGen.make_ptr_vector_cast()CUDACodeGen.node_dispatch_predicate()CUDACodeGen.preprocess()CUDACodeGen.process_out_memlets()CUDACodeGen.state_dispatch_predicate()CUDACodeGen.target_nameCUDACodeGen.title
cpu_to_gpu_cpred()prod()
- dace.codegen.targets.framecode module
- dace.codegen.targets.mpi module
- dace.codegen.targets.target module
IllegalCopyTargetCodeGeneratorTargetCodeGenerator.allocate_array()TargetCodeGenerator.cmake_options()TargetCodeGenerator.copy_memory()TargetCodeGenerator.deallocate_array()TargetCodeGenerator.declare_array()TargetCodeGenerator.extensions()TargetCodeGenerator.generate_node()TargetCodeGenerator.generate_scope()TargetCodeGenerator.generate_state()TargetCodeGenerator.get_generated_codeobjects()TargetCodeGenerator.has_finalizerTargetCodeGenerator.has_initializerTargetCodeGenerator.preprocess()TargetCodeGenerator.register()TargetCodeGenerator.unregister()
make_absolute()
- dace.codegen.targets.fpga module
FPGACodeGenFPGACodeGen.allocate_array()FPGACodeGen.copy_memory()FPGACodeGen.deallocate_array()FPGACodeGen.declare_array()FPGACodeGen.define_out_memlet()FPGACodeGen.find_rtl_tasklet()FPGACodeGen.generate_host_function_boilerplate()FPGACodeGen.generate_kernel()FPGACodeGen.generate_modules()FPGACodeGen.generate_nested_state()FPGACodeGen.generate_node()FPGACodeGen.generate_nsdfg_arguments()FPGACodeGen.generate_nsdfg_call()FPGACodeGen.generate_nsdfg_header()FPGACodeGen.generate_scope()FPGACodeGen.generate_state()FPGACodeGen.generate_tasklet_postamble()FPGACodeGen.generate_tasklet_preamble()FPGACodeGen.get_next_scope_entries()FPGACodeGen.has_finalizerFPGACodeGen.has_initializerFPGACodeGen.instrument_opencl_kernel()FPGACodeGen.is_multi_pumped_subgraph()FPGACodeGen.languageFPGACodeGen.make_opencl_parameter()FPGACodeGen.make_parameters()FPGACodeGen.make_ptr_assignment()FPGACodeGen.make_ptr_vector_cast()FPGACodeGen.partition_kernels()FPGACodeGen.preprocess()FPGACodeGen.process_out_memlets()FPGACodeGen.shared_data()FPGACodeGen.target_nameFPGACodeGen.title
fpga_ptr()get_multibank_ranges_from_subset()is_external_stream()is_fpga_array()is_multibank_array()is_multibank_array_with_distributed_index()is_vendor_supported()iterate_distributed_subset()iterate_multibank_interface_ids()modify_distributed_subset()parse_location_bank()unqualify_fpga_array_name()vector_element_type_of()
- dace.codegen.targets.xilinx module
- dace.codegen.targets.intel_fpga module
IntelFPGACodeGenIntelFPGACodeGen.allocate_view()IntelFPGACodeGen.cmake_options()IntelFPGACodeGen.create_mangled_channel_name()IntelFPGACodeGen.create_mangled_module_name()IntelFPGACodeGen.define_local_array()IntelFPGACodeGen.define_shift_register()IntelFPGACodeGen.define_stream()IntelFPGACodeGen.generate_channel_writes()IntelFPGACodeGen.generate_constants()IntelFPGACodeGen.generate_converters()IntelFPGACodeGen.generate_flatten_loop_post()IntelFPGACodeGen.generate_flatten_loop_pre()IntelFPGACodeGen.generate_host_function_body()IntelFPGACodeGen.generate_host_function_prologue()IntelFPGACodeGen.generate_kernel_internal()IntelFPGACodeGen.generate_memlet_definition()IntelFPGACodeGen.generate_module()IntelFPGACodeGen.generate_no_dependence_post()IntelFPGACodeGen.generate_no_dependence_pre()IntelFPGACodeGen.generate_nsdfg_arguments()IntelFPGACodeGen.generate_nsdfg_header()IntelFPGACodeGen.generate_pipeline_loop_post()IntelFPGACodeGen.generate_pipeline_loop_pre()IntelFPGACodeGen.generate_tasklet_postamble()IntelFPGACodeGen.generate_undefines()IntelFPGACodeGen.generate_unroll_loop_post()IntelFPGACodeGen.generate_unroll_loop_pre()IntelFPGACodeGen.get_generated_codeobjects()IntelFPGACodeGen.get_mangled_channel_name()IntelFPGACodeGen.languageIntelFPGACodeGen.make_kernel_argument()IntelFPGACodeGen.make_ptr_vector_cast()IntelFPGACodeGen.make_read()IntelFPGACodeGen.make_shift_register_write()IntelFPGACodeGen.make_vector_type()IntelFPGACodeGen.make_write()IntelFPGACodeGen.process_out_memlets()IntelFPGACodeGen.target_nameIntelFPGACodeGen.titleIntelFPGACodeGen.unparse_tasklet()IntelFPGACodeGen.write_and_resolve_expr()
OpenCLDaceKeywordRemoverOpenCLDaceKeywordRemover.ctypesOpenCLDaceKeywordRemover.nptypesOpenCLDaceKeywordRemover.nptypes_to_ctypesOpenCLDaceKeywordRemover.visit_Assign()OpenCLDaceKeywordRemover.visit_Attribute()OpenCLDaceKeywordRemover.visit_BinOp()OpenCLDaceKeywordRemover.visit_Call()OpenCLDaceKeywordRemover.visit_Name()
- Module contents
- dace.codegen.instrumentation package
- Submodules
- dace.codegen.codegen module
- dace.codegen.codeobject module
- dace.codegen.compiled_sdfg module
- dace.codegen.compiler module
- dace.codegen.control_flow module
- dace.codegen.cppunparse module
CPPLocalsCPPUnparserCPPUnparser.binopCPPUnparser.boolopsCPPUnparser.callboolsCPPUnparser.callcmpsCPPUnparser.cmpopsCPPUnparser.dispatch()CPPUnparser.dispatch_lhs_tuple()CPPUnparser.enter()CPPUnparser.fill()CPPUnparser.format_conversionsCPPUnparser.funcopsCPPUnparser.leave()CPPUnparser.unopCPPUnparser.write()
LocalSchemecppunparse()interleave()py2cpp()pyexpr2cpp()
- dace.codegen.dispatcher module
DefinedMemletsDefinedTypeTargetDispatcherTargetDispatcher.declared_arraysTargetDispatcher.defined_varsTargetDispatcher.dispatch_allocate()TargetDispatcher.dispatch_copy()TargetDispatcher.dispatch_deallocate()TargetDispatcher.dispatch_node()TargetDispatcher.dispatch_output_definition()TargetDispatcher.dispatch_scope()TargetDispatcher.dispatch_state()TargetDispatcher.dispatch_subgraph()TargetDispatcher.get_array_dispatcher()TargetDispatcher.get_copy_dispatcher()TargetDispatcher.get_generic_node_dispatcher()TargetDispatcher.get_generic_state_dispatcher()TargetDispatcher.get_node_dispatcher()TargetDispatcher.get_predicated_node_dispatchers()TargetDispatcher.get_predicated_state_dispatchers()TargetDispatcher.get_scope_dispatcher()TargetDispatcher.get_state_dispatcher()TargetDispatcher.register_array_dispatcher()TargetDispatcher.register_copy_dispatcher()TargetDispatcher.register_map_dispatcher()TargetDispatcher.register_node_dispatcher()TargetDispatcher.register_state_dispatcher()TargetDispatcher.used_environmentsTargetDispatcher.used_targets
- dace.codegen.exceptions module
- dace.codegen.prettycode module
- Module contents
- Subpackages
- dace.cli package
- dace.frontend package
- Subpackages
- dace.frontend.common package
- dace.frontend.octave package
- Submodules
- dace.frontend.octave.ast_arrayaccess module
- dace.frontend.octave.ast_assign module
- dace.frontend.octave.ast_expression module
AST_BinExpressionAST_BinExpression.generate_code()AST_BinExpression.get_basetype()AST_BinExpression.get_children()AST_BinExpression.get_dims()AST_BinExpression.matrix2d_matrix2d_mult()AST_BinExpression.matrix2d_matrix2d_plus_or_minus()AST_BinExpression.matrix2d_scalar()AST_BinExpression.provide_parents()AST_BinExpression.replace_child()AST_BinExpression.scalar_scalar()AST_BinExpression.vec_mult_vect()
AST_UnaryExpression
- dace.frontend.octave.ast_function module
- dace.frontend.octave.ast_loop module
- dace.frontend.octave.ast_matrix module
- dace.frontend.octave.ast_node module
AST_NodeAST_Node.defined_variables()AST_Node.find_data_node_in_sdfg_state()AST_Node.generate_code()AST_Node.get_children()AST_Node.get_datanode()AST_Node.get_initializers()AST_Node.get_name_in_sdfg()AST_Node.get_new_tmpvar()AST_Node.get_parent()AST_Node.print_as_tree()AST_Node.provide_parents()AST_Node.replace_child()AST_Node.replace_parent()AST_Node.search_vardef_in_scope()AST_Node.shortdesc()AST_Node.specialize()
AST_Statements
- dace.frontend.octave.ast_nullstmt module
- dace.frontend.octave.ast_range module
- dace.frontend.octave.ast_values module
- dace.frontend.octave.lexer module
- dace.frontend.octave.parse module
p_arg1()p_arg2()p_arg_list()p_args()p_break_stmt()p_case_list()p_cellarray()p_cellarray_2()p_cellarrayref()p_command()p_comment_stmt()p_concat_list1()p_concat_list2()p_continue_stmt()p_elseif_stmt()p_end()p_end_function()p_error()p_error_stmt()p_expr()p_expr1()p_expr2()p_expr_2()p_expr_colon()p_expr_end()p_expr_ident()p_expr_list()p_expr_number()p_expr_stmt()p_expr_string()p_exprs()p_field_expr()p_foo_stmt()p_for_stmt()p_func_stmt()p_funcall_expr()p_global()p_global_list()p_global_stmt()p_ident_init_opt()p_if_stmt()p_lambda_args()p_lambda_expr()p_matrix()p_matrix_2()p_null_stmt()p_parens_expr()p_persistent_stmt()p_ret()p_return_stmt()p_semi_opt()p_separator()p_stmt()p_stmt_list()p_stmt_list_opt()p_switch_stmt()p_top()p_transpose_expr()p_try_catch()p_unwind()p_while_stmt()parse()
- dace.frontend.octave.parsetab module
- Module contents
- dace.frontend.python package
- Submodules
- dace.frontend.python.astutils module
ASTFindReplaceASTHelperMixinAnnotateTopLevelConstantExtractorExtNodeTransformerExtNodeVisitorExtUnparserNameFoundRemoveSubscriptsTaskletFreeSymbolVisitorastrange_to_symrange()copy_tree()create_constant()escape_string()evalnode()function_to_ast()is_constant()negate_expr()rname()slice_to_subscript()subscript_to_ast_slice()subscript_to_ast_slice_recursive()subscript_to_slice()unparse()
- dace.frontend.python.cached_program module
- dace.frontend.python.common module
- dace.frontend.python.interface module
- dace.frontend.python.memlet_parser module
- dace.frontend.python.ndloop module
- dace.frontend.python.newast module
AddTransientMethodsProgramVisitorProgramVisitor.create_callback()ProgramVisitor.definedProgramVisitor.increment_progress()ProgramVisitor.make_slice()ProgramVisitor.parse_program()ProgramVisitor.progress_barProgramVisitor.progress_count()ProgramVisitor.start_timeProgramVisitor.visit()ProgramVisitor.visit_AnnAssign()ProgramVisitor.visit_Assign()ProgramVisitor.visit_AsyncWith()ProgramVisitor.visit_Attribute()ProgramVisitor.visit_AugAssign()ProgramVisitor.visit_BinOp()ProgramVisitor.visit_BoolOp()ProgramVisitor.visit_Break()ProgramVisitor.visit_Bytes()ProgramVisitor.visit_Call()ProgramVisitor.visit_Compare()ProgramVisitor.visit_Constant()ProgramVisitor.visit_Continue()ProgramVisitor.visit_Dict()ProgramVisitor.visit_ExtSlice()ProgramVisitor.visit_For()ProgramVisitor.visit_FunctionDef()ProgramVisitor.visit_If()ProgramVisitor.visit_Index()ProgramVisitor.visit_Lambda()ProgramVisitor.visit_List()ProgramVisitor.visit_Name()ProgramVisitor.visit_NameConstant()ProgramVisitor.visit_NamedExpr()ProgramVisitor.visit_Num()ProgramVisitor.visit_Return()ProgramVisitor.visit_Set()ProgramVisitor.visit_Str()ProgramVisitor.visit_Subscript()ProgramVisitor.visit_TopLevelExpr()ProgramVisitor.visit_Tuple()ProgramVisitor.visit_UnaryOp()ProgramVisitor.visit_While()ProgramVisitor.visit_With()
SkipCallTaskletTransformeradd_indirection_subgraph()parse_dace_program()specifies_datatype()until()
- dace.frontend.python.parser module
- dace.frontend.python.preprocessing module
ArrayClosureResolverAugAssignExpanderCallTreeResolverConditionalCodeResolverContextManagerInlinerDaceRecursionErrorDeadCodeEliminatorDisallowedAssignmentCheckerGlobalResolverGlobalResolver.generic_visit()GlobalResolver.global_value_to_node()GlobalResolver.globalsGlobalResolver.visit_Assert()GlobalResolver.visit_AsyncFunctionDef()GlobalResolver.visit_Attribute()GlobalResolver.visit_AugAssign()GlobalResolver.visit_Call()GlobalResolver.visit_For()GlobalResolver.visit_FunctionDef()GlobalResolver.visit_JoinedStr()GlobalResolver.visit_Lambda()GlobalResolver.visit_Name()GlobalResolver.visit_Raise()GlobalResolver.visit_Subscript()GlobalResolver.visit_TopLevelExpr()GlobalResolver.visit_keyword()
LoopUnrollerModuleResolverPreprocessedASTRewriteSympyEqualityStructTransformerfind_disallowed_statements()flatten_callback()has_replacement()preprocess_dace_program()
- dace.frontend.python.replacements module
- dace.frontend.python.tasklet_runner module
- dace.frontend.python.wrappers module
- Module contents
- Submodules
- dace.frontend.operations module
- Module contents
- Subpackages
- dace.sdfg package
- Submodules
- dace.sdfg.graph module
DiGraphDiGraph.add_edge()DiGraph.add_node()DiGraph.edges()DiGraph.edges_between()DiGraph.find_cycles()DiGraph.has_cycles()DiGraph.in_degree()DiGraph.in_edges()DiGraph.is_directed()DiGraph.is_multigraph()DiGraph.nodes()DiGraph.number_of_edges()DiGraph.number_of_nodes()DiGraph.out_degree()DiGraph.out_edges()DiGraph.remove_edge()DiGraph.remove_node()
EdgeEdgeNotFoundErrorGraphGraph.add_edge()Graph.add_node()Graph.add_nodes_from()Graph.all_edges()Graph.all_nodes_between()Graph.all_simple_paths()Graph.bfs_edges()Graph.degree()Graph.dfs_edges()Graph.edge_id()Graph.edges()Graph.edges_between()Graph.in_degree()Graph.in_edges()Graph.is_directed()Graph.is_multigraph()Graph.neighbors()Graph.node_id()Graph.nodes()Graph.number_of_edges()Graph.number_of_nodes()Graph.nxGraph.out_degree()Graph.out_edges()Graph.predecessors()Graph.remove_edge()Graph.remove_node()Graph.remove_nodes_from()Graph.sink_nodes()Graph.source_nodes()Graph.successors()Graph.to_json()Graph.topological_sort()
MultiConnectorEdgeMultiDiConnectorGraphMultiDiGraphMultiEdgeNodeNotFoundErrorOrderedDiGraphOrderedDiGraph.add_edge()OrderedDiGraph.add_node()OrderedDiGraph.edges()OrderedDiGraph.edges_between()OrderedDiGraph.find_cycles()OrderedDiGraph.has_cycles()OrderedDiGraph.in_degree()OrderedDiGraph.in_edges()OrderedDiGraph.is_directed()OrderedDiGraph.is_multigraph()OrderedDiGraph.node()OrderedDiGraph.node_id()OrderedDiGraph.nodes()OrderedDiGraph.number_of_edges()OrderedDiGraph.number_of_nodes()OrderedDiGraph.nxOrderedDiGraph.out_degree()OrderedDiGraph.out_edges()OrderedDiGraph.remove_edge()OrderedDiGraph.remove_node()OrderedDiGraph.reverse()
OrderedMultiDiConnectorGraphOrderedMultiDiConnectorGraph.add_edge()OrderedMultiDiConnectorGraph.add_nedge()OrderedMultiDiConnectorGraph.edges_between()OrderedMultiDiConnectorGraph.in_edges()OrderedMultiDiConnectorGraph.is_multigraph()OrderedMultiDiConnectorGraph.out_edges()OrderedMultiDiConnectorGraph.remove_edge()OrderedMultiDiConnectorGraph.reverse()
OrderedMultiDiGraphSubgraphViewSubgraphView.add_edge()SubgraphView.add_node()SubgraphView.add_nodes_from()SubgraphView.edges()SubgraphView.edges_between()SubgraphView.graphSubgraphView.in_degree()SubgraphView.in_edges()SubgraphView.is_directed()SubgraphView.is_multigraph()SubgraphView.node_id()SubgraphView.nodes()SubgraphView.number_of_edges()SubgraphView.number_of_nodes()SubgraphView.out_degree()SubgraphView.out_edges()SubgraphView.remove_edge()SubgraphView.remove_node()SubgraphView.remove_nodes_from()
- dace.sdfg.nodes module
AccessNodeCodeNodeConsumeConsumeEntryConsumeEntry.chunksizeConsumeEntry.conditionConsumeEntry.consumeConsumeEntry.debuginfoConsumeEntry.free_symbolsConsumeEntry.from_json()ConsumeEntry.instrumentConsumeEntry.is_collapsedConsumeEntry.labelConsumeEntry.mapConsumeEntry.new_symbols()ConsumeEntry.num_pesConsumeEntry.pe_indexConsumeEntry.properties()ConsumeEntry.schedule
ConsumeExitEntryNodeExitNodeLibraryNodeMapMapEntryMapEntry.collapseMapEntry.debuginfoMapEntry.free_symbolsMapEntry.from_json()MapEntry.gpu_block_sizeMapEntry.instrumentMapEntry.is_collapsedMapEntry.labelMapEntry.mapMapEntry.map_type()MapEntry.new_symbols()MapEntry.omp_chunk_sizeMapEntry.omp_num_threadsMapEntry.omp_scheduleMapEntry.paramsMapEntry.properties()MapEntry.rangeMapEntry.scheduleMapEntry.unroll
MapExitNestedSDFGNestedSDFG.debuginfoNestedSDFG.free_symbolsNestedSDFG.from_json()NestedSDFG.infer_connector_types()NestedSDFG.instrumentNestedSDFG.is_collapsedNestedSDFG.no_inlineNestedSDFG.properties()NestedSDFG.scheduleNestedSDFG.sdfgNestedSDFG.symbol_mappingNestedSDFG.unique_nameNestedSDFG.validate()
NodeNode.add_in_connector()Node.add_out_connector()Node.free_symbolsNode.in_connectorsNode.infer_connector_types()Node.last_connector()Node.new_symbols()Node.next_connector()Node.out_connectorsNode.properties()Node.remove_in_connector()Node.remove_out_connector()Node.to_json()Node.validate()
PipelineEntryPipelineExitPipelineScopeRTLTaskletTaskletTasklet.codeTasklet.code_exitTasklet.code_globalTasklet.code_initTasklet.debuginfoTasklet.free_symbolsTasklet.from_json()Tasklet.has_side_effects()Tasklet.infer_connector_types()Tasklet.instrumentTasklet.languageTasklet.nameTasklet.properties()Tasklet.side_effectsTasklet.state_fieldsTasklet.validate()
UnregisteredLibraryNodefull_class_path()
- dace.sdfg.analysis module
- dace.sdfg.infer_types module
- dace.sdfg.propagation module
AffineSMemletConstantRangeMemletConstantSMemletGenericSMemletMemletPatternModuloSMemletSeparableMemletSeparableMemletPatternalign_memlet()propagate_memlet()propagate_memlets_nested_sdfg()propagate_memlets_scope()propagate_memlets_sdfg()propagate_memlets_state()propagate_states()propagate_subset()reset_state_annotations()
- dace.sdfg.replace module
- dace.sdfg.scope module
- dace.sdfg.sdfg module
InterstateEdgeInterstateEdge.assignmentsInterstateEdge.conditionInterstateEdge.condition_sympy()InterstateEdge.free_symbolsInterstateEdge.from_json()InterstateEdge.get_read_memlets()InterstateEdge.is_unconditional()InterstateEdge.labelInterstateEdge.new_symbols()InterstateEdge.properties()InterstateEdge.read_symbols()InterstateEdge.replace()InterstateEdge.replace_dict()InterstateEdge.to_json()
LogicalGroupSDFGSDFG.add_array()SDFG.add_constant()SDFG.add_datadesc()SDFG.add_edge()SDFG.add_loop()SDFG.add_node()SDFG.add_pgrid()SDFG.add_rdistrarray()SDFG.add_reference()SDFG.add_scalar()SDFG.add_state()SDFG.add_state_after()SDFG.add_state_before()SDFG.add_stream()SDFG.add_subarray()SDFG.add_symbol()SDFG.add_temp_transient()SDFG.add_temp_transient_like()SDFG.add_transient()SDFG.add_view()SDFG.all_edges_recursive()SDFG.all_nodes_recursive()SDFG.all_sdfgs_recursive()SDFG.append_exit_code()SDFG.append_global_code()SDFG.append_init_code()SDFG.append_transformation()SDFG.apply_fpga_transformations()SDFG.apply_gpu_transformations()SDFG.apply_strict_transformations()SDFG.apply_transformations()SDFG.apply_transformations_once_everywhere()SDFG.apply_transformations_repeated()SDFG.arg_namesSDFG.arglist()SDFG.argument_typecheck()SDFG.arraysSDFG.arrays_recursive()SDFG.available_data_reports()SDFG.build_folderSDFG.call_with_instrumented_data()SDFG.callback_mappingSDFG.clear_data_reports()SDFG.clear_instrumentation_reports()SDFG.compile()SDFG.constantsSDFG.constants_propSDFG.data()SDFG.debuginfoSDFG.exit_codeSDFG.expand_library_nodes()SDFG.fill_scope_connectors()SDFG.find_new_constant()SDFG.find_new_symbol()SDFG.find_state()SDFG.free_symbolsSDFG.from_file()SDFG.from_json()SDFG.generate_code()SDFG.get_instrumentation_reports()SDFG.get_instrumented_data()SDFG.get_latest_report()SDFG.global_codeSDFG.hash_sdfg()SDFG.init_codeSDFG.init_signature()SDFG.input_arrays()SDFG.instrumentSDFG.is_instrumented()SDFG.is_loaded()SDFG.is_valid()SDFG.labelSDFG.logical_groupsSDFG.make_array_memlet()SDFG.nameSDFG.openmp_sectionsSDFG.optimize()SDFG.orig_sdfgSDFG.output_arrays()SDFG.parentSDFG.parent_nsdfg_nodeSDFG.parent_sdfgSDFG.predecessor_state_transitions()SDFG.predecessor_states()SDFG.prepend_exit_code()SDFG.process_gridsSDFG.propagateSDFG.properties()SDFG.rdistrarraysSDFG.read_and_write_sets()SDFG.remove_data()SDFG.remove_node()SDFG.remove_symbol()SDFG.replace()SDFG.replace_dict()SDFG.reset_sdfg_list()SDFG.save()SDFG.sdfg_idSDFG.sdfg_listSDFG.set_exit_code()SDFG.set_global_code()SDFG.set_init_code()SDFG.set_sourcecode()SDFG.shared_transients()SDFG.signature()SDFG.signature_arglist()SDFG.simplify()SDFG.specialize()SDFG.start_stateSDFG.states()SDFG.subarraysSDFG.symbolsSDFG.temp_data_name()SDFG.to_json()SDFG.transformation_histSDFG.transients()SDFG.update_sdfg_list()SDFG.validate()SDFG.view()
memlets_in_ast()
- dace.sdfg.state module
SDFGStateSDFGState.add_access()SDFGState.add_array()SDFGState.add_consume()SDFGState.add_edge()SDFGState.add_edge_pair()SDFGState.add_map()SDFGState.add_mapped_tasklet()SDFGState.add_memlet_path()SDFGState.add_nested_sdfg()SDFGState.add_node()SDFGState.add_pipeline()SDFGState.add_read()SDFGState.add_reduce()SDFGState.add_scalar()SDFGState.add_stream()SDFGState.add_tasklet()SDFGState.add_transient()SDFGState.add_write()SDFGState.all_edges_and_connectors()SDFGState.dynamic_executionsSDFGState.executionsSDFGState.fill_scope_connectors()SDFGState.from_json()SDFGState.instrumentSDFGState.is_collapsedSDFGState.is_empty()SDFGState.labelSDFGState.locationSDFGState.nameSDFGState.nodes()SDFGState.nosyncSDFGState.parentSDFGState.properties()SDFGState.rangesSDFGState.remove_edge()SDFGState.remove_edge_and_connectors()SDFGState.remove_memlet_path()SDFGState.remove_node()SDFGState.set_default_lineinfo()SDFGState.set_label()SDFGState.symbols_defined_at()SDFGState.to_json()SDFGState.validate()
StateGraphViewStateGraphView.all_edges_recursive()StateGraphView.all_nodes_recursive()StateGraphView.all_transients()StateGraphView.arglist()StateGraphView.data_nodes()StateGraphView.defined_symbols()StateGraphView.edges()StateGraphView.edges_by_connector()StateGraphView.entry_node()StateGraphView.exit_node()StateGraphView.free_symbolsStateGraphView.in_edges_by_connector()StateGraphView.memlet_path()StateGraphView.memlet_tree()StateGraphView.nodes()StateGraphView.out_edges_by_connector()StateGraphView.read_and_write_sets()StateGraphView.replace()StateGraphView.replace_dict()StateGraphView.scope_children()StateGraphView.scope_dict()StateGraphView.scope_leaves()StateGraphView.scope_subgraph()StateGraphView.scope_tree()StateGraphView.signature_arglist()StateGraphView.top_level_transients()
StateSubgraphView
- dace.sdfg.utils module
StopTraversalchange_edge_dest()change_edge_src()concurrent_subgraphs()consolidate_edges()consolidate_edges_scope()depth_limited_dfs_iter()depth_limited_search()dfs_conditional()dfs_topological_sort()distributed_compile()dynamic_map_inputs()find_input_arraynode()find_output_arraynode()fuse_states()get_all_view_nodes()get_last_view_node()get_next_nonempty_states()get_view_edge()get_view_node()has_dynamic_map_inputs()inline_sdfgs()is_array_stream_view()is_fpga_kernel()is_nonfree_sym_dependent()is_parallel()load_precompiled_sdfg()local_transients()map_view_to_array()merge_maps()node_path_graph()nodes_in_all_simple_paths()postdominators()remove_edge_and_dangling_path()scope_aware_topological_sort()separate_maps()trace_nested_access()traverse_sdfg_with_defined_symbols()unique_node_repr()weakly_connected_component()
- dace.sdfg.validation module
- Module contents
- dace.transformation package
- Subpackages
- dace.transformation.auto package
- dace.transformation.dataflow package
- Submodules
- dace.transformation.dataflow.copy_to_device module
- dace.transformation.dataflow.double_buffering module
- dace.transformation.dataflow.gpu_transform module
GPUTransformMapGPUTransformMap.apply()GPUTransformMap.can_be_applied()GPUTransformMap.expressions()GPUTransformMap.fullcopyGPUTransformMap.map_entryGPUTransformMap.match_to_str()GPUTransformMap.properties()GPUTransformMap.reduceGPUTransformMap.register_transGPUTransformMap.sequential_innermapsGPUTransformMap.stdlibGPUTransformMap.toplevel_trans
- dace.transformation.dataflow.gpu_transform_local_storage module
GPUTransformLocalStorageGPUTransformLocalStorage.apply()GPUTransformLocalStorage.can_be_applied()GPUTransformLocalStorage.expressions()GPUTransformLocalStorage.fullcopyGPUTransformLocalStorage.map_entryGPUTransformLocalStorage.match_to_str()GPUTransformLocalStorage.nested_seqGPUTransformLocalStorage.properties()GPUTransformLocalStorage.reduceGPUTransformLocalStorage.stdlib
in_path()in_scope()
- dace.transformation.dataflow.local_storage module
- dace.transformation.dataflow.map_collapse module
- dace.transformation.dataflow.map_expansion module
- dace.transformation.dataflow.map_fission module
- dace.transformation.dataflow.map_for_loop module
- dace.transformation.dataflow.map_fusion module
- dace.transformation.dataflow.map_interchange module
- dace.transformation.dataflow.mapreduce module
MapReduceFusionMapReduceFusion.apply()MapReduceFusion.can_be_applied()MapReduceFusion.expressions()MapReduceFusion.in_arrayMapReduceFusion.match_to_str()MapReduceFusion.no_initMapReduceFusion.out_arrayMapReduceFusion.properties()MapReduceFusion.reduceMapReduceFusion.stdlibMapReduceFusion.taskletMapReduceFusion.tmap_exit
MapWCRFusionMapWCRFusion.apply()MapWCRFusion.can_be_applied()MapWCRFusion.expressions()MapWCRFusion.in_arrayMapWCRFusion.match_to_str()MapWCRFusion.out_arrayMapWCRFusion.rmap_in_crMapWCRFusion.rmap_in_entryMapWCRFusion.rmap_in_taskletMapWCRFusion.rmap_out_entryMapWCRFusion.rmap_out_exitMapWCRFusion.taskletMapWCRFusion.tmap_exit
- dace.transformation.dataflow.matrix_product_transpose module
MatrixProductTransposeMatrixProductTranspose.a_times_bMatrixProductTranspose.apply()MatrixProductTranspose.atMatrixProductTranspose.blasMatrixProductTranspose.btMatrixProductTranspose.can_be_applied()MatrixProductTranspose.expressions()MatrixProductTranspose.match_to_str()MatrixProductTranspose.properties()MatrixProductTranspose.transpose_aMatrixProductTranspose.transpose_b
- dace.transformation.dataflow.merge_arrays module
- dace.transformation.dataflow.mpi module
- dace.transformation.dataflow.otf_map_fusion module
- dace.transformation.dataflow.reduce_expansion module
ReduceExpansionReduceExpansion.apply()ReduceExpansion.can_be_applied()ReduceExpansion.create_in_transientReduceExpansion.create_out_transientReduceExpansion.debugReduceExpansion.expand()ReduceExpansion.expressions()ReduceExpansion.properties()ReduceExpansion.reduceReduceExpansion.reduce_implementationReduceExpansion.reduction_type_identityReduceExpansion.reduction_type_updateReduceExpansion.stdlib
- dace.transformation.dataflow.redundant_array module
- dace.transformation.dataflow.redundant_array_copying module
- dace.transformation.dataflow.streaming_memory module
StreamingCompositionStreamingMemoryStreamingMemory.accessStreamingMemory.apply()StreamingMemory.buffer_sizeStreamingMemory.can_be_applied()StreamingMemory.entryStreamingMemory.exitStreamingMemory.expressions()StreamingMemory.memory_buffering_target_bytesStreamingMemory.properties()StreamingMemory.storageStreamingMemory.use_memory_buffering
get_post_state()is_int()
- dace.transformation.dataflow.stream_transient module
- dace.transformation.dataflow.strip_mining module
StripMiningStripMining.annotates_memlets()StripMining.apply()StripMining.can_be_applied()StripMining.dim_idxStripMining.divides_evenlyStripMining.expressions()StripMining.map_entryStripMining.match_to_str()StripMining.new_dim_prefixStripMining.properties()StripMining.skewStripMining.stridedStripMining.tile_offsetStripMining.tile_sizeStripMining.tile_strideStripMining.tiling_type
calc_set_image()calc_set_image_index()calc_set_image_range()calc_set_union()
- dace.transformation.dataflow.tiling module
- dace.transformation.dataflow.vectorization module
- dace.transformation.dataflow.warp_tiling module
- Module contents
- dace.transformation.interstate package
- Submodules
- dace.transformation.interstate.fpga_transform_sdfg module
- dace.transformation.interstate.fpga_transform_state module
- dace.transformation.interstate.gpu_transform_sdfg module
GPUTransformSDFGGPUTransformSDFG.annotates_memlets()GPUTransformSDFG.apply()GPUTransformSDFG.can_be_applied()GPUTransformSDFG.exclude_copyinGPUTransformSDFG.exclude_copyoutGPUTransformSDFG.exclude_taskletsGPUTransformSDFG.expressions()GPUTransformSDFG.properties()GPUTransformSDFG.register_transGPUTransformSDFG.sequential_innermapsGPUTransformSDFG.simplifyGPUTransformSDFG.skip_scalar_taskletsGPUTransformSDFG.toplevel_trans
- dace.transformation.interstate.loop_detection module
- dace.transformation.interstate.loop_to_map module
- dace.transformation.interstate.move_loop_into_map module
- dace.transformation.interstate.loop_peeling module
- dace.transformation.interstate.loop_unroll module
- dace.transformation.interstate.sdfg_nesting module
- dace.transformation.interstate.state_elimination module
- dace.transformation.interstate.state_fusion module
- Module contents
- Available Passes
- Scalar-to-Symbol Promotion
- Dead Memory Elimination and Merging
ArrayEliminationArrayElimination.CATEGORYArrayElimination.apply_pass()ArrayElimination.depends_on()ArrayElimination.merge_access_nodes()ArrayElimination.modifies()ArrayElimination.properties()ArrayElimination.remove_redundant_copies()ArrayElimination.remove_redundant_views()ArrayElimination.report()ArrayElimination.should_reapply()
TransientReuse
- Dead Code Elimination
DeadStateEliminationDeadStateElimination.CATEGORYDeadStateElimination.apply_pass()DeadStateElimination.find_dead_states()DeadStateElimination.is_definitely_not_taken()DeadStateElimination.is_definitely_taken()DeadStateElimination.modifies()DeadStateElimination.properties()DeadStateElimination.report()DeadStateElimination.should_reapply()
DeadDataflowEliminationDeadDataflowElimination.CATEGORYDeadDataflowElimination.apply_pass()DeadDataflowElimination.depends_on()DeadDataflowElimination.modifies()DeadDataflowElimination.properties()DeadDataflowElimination.remove_persistent_memoryDeadDataflowElimination.report()DeadDataflowElimination.should_reapply()DeadDataflowElimination.skip_library_nodes
PROTECTED_NAMESRemoveUnusedSymbols
- Constant Propagation
ConstantPropagationConstantPropagation.CATEGORYConstantPropagation.apply_pass()ConstantPropagation.collect_constants()ConstantPropagation.modifies()ConstantPropagation.progressConstantPropagation.properties()ConstantPropagation.recursiveConstantPropagation.report()ConstantPropagation.should_apply()ConstantPropagation.should_reapply()
OptionalArrayInference
- Memlet Consolidation
- State Fusion and SDFG Inlining
- Analysis Passes
- The Simplify Pass Pipeline
- Module contents
- dace.transformation.subgraph package
- Submodules
- dace.transformation.subgraph.expansion module
- dace.transformation.subgraph.gpu_persistent_fusion module
GPUPersistentKernelGPUPersistentKernel.apply()GPUPersistentKernel.can_be_applied()GPUPersistentKernel.get_entry_states()GPUPersistentKernel.get_exit_states()GPUPersistentKernel.include_in_assignmentGPUPersistentKernel.is_gpu_state()GPUPersistentKernel.kernel_prefixGPUPersistentKernel.properties()GPUPersistentKernel.validate
- dace.transformation.subgraph.helpers module
- dace.transformation.subgraph.subgraph_fusion module
SubgraphFusionSubgraphFusion.adjust_arrays_nsdfg()SubgraphFusion.apply()SubgraphFusion.can_be_applied()SubgraphFusion.check_topo_feasibility()SubgraphFusion.clone_intermediate_nodes()SubgraphFusion.consolidateSubgraphFusion.copy_edge()SubgraphFusion.debugSubgraphFusion.determine_compressible_nodes()SubgraphFusion.determine_invariant_dimensions()SubgraphFusion.disjoint_subsetsSubgraphFusion.fuse()SubgraphFusion.get_adjacent_nodes()SubgraphFusion.get_invariant_dimensions()SubgraphFusion.keep_globalSubgraphFusion.prepare_intermediate_nodes()SubgraphFusion.propagateSubgraphFusion.properties()SubgraphFusion.schedule_innermapsSubgraphFusion.transient_allocation
- Module contents
- Submodules
- Passes and Pipelines
- Transformations
ExpandTransformationExpandTransformation.apply()ExpandTransformation.can_be_applied()ExpandTransformation.expansion()ExpandTransformation.expressions()ExpandTransformation.from_json()ExpandTransformation.match_to_str()ExpandTransformation.postprocessing()ExpandTransformation.properties()ExpandTransformation.to_json()
MultiStateTransformationPatternNodePatternTransformationPatternTransformation.annotates_memlets()PatternTransformation.apply()PatternTransformation.apply_pass()PatternTransformation.apply_pattern()PatternTransformation.apply_to()PatternTransformation.can_be_applied()PatternTransformation.expr_indexPatternTransformation.expressions()PatternTransformation.from_json()PatternTransformation.match_to_str()PatternTransformation.print_match()PatternTransformation.properties()PatternTransformation.sdfg_idPatternTransformation.setup_match()PatternTransformation.state_idPatternTransformation.subclasses_recursive()PatternTransformation.subgraphPatternTransformation.to_json()
SingleStateTransformationSubgraphTransformationSubgraphTransformation.apply()SubgraphTransformation.apply_pass()SubgraphTransformation.apply_to()SubgraphTransformation.can_be_applied()SubgraphTransformation.from_json()SubgraphTransformation.get_subgraph()SubgraphTransformation.properties()SubgraphTransformation.sdfg_idSubgraphTransformation.setup_match()SubgraphTransformation.state_idSubgraphTransformation.subclasses_recursive()SubgraphTransformation.subgraphSubgraphTransformation.subgraph_view()SubgraphTransformation.to_json()
TransformationBase
- dace.transformation.helpers module
are_subsets_contiguous()can_run_state_on_fpga()constant_symbols()contained_in()extract_map_dims()find_contiguous_subsets()find_sdfg_control_flow()get_internal_scopes()get_parent_map()gpu_map_has_explicit_threadblocks()is_symbol_unused()nest_sdfg_control_flow()nest_sdfg_subgraph()nest_state_subgraph()offset_map()permute_map()reconnect_edge_through_map()redirect_edge()replicate_scope()scope_tree_recursive()simplify_state()split_interstate_edges()state_fission()tile()unsqueeze_memlet()
- dace.transformation.passes.pattern_matching module
PatternApplyOnceEverywherePatternMatchAndApplyPatternMatchAndApply.CATEGORYPatternMatchAndApply.apply_pass()PatternMatchAndApply.depends_on()PatternMatchAndApply.modifies()PatternMatchAndApply.permissivePatternMatchAndApply.print_reportPatternMatchAndApply.progressPatternMatchAndApply.properties()PatternMatchAndApply.should_reapply()PatternMatchAndApply.statesPatternMatchAndApply.transformationsPatternMatchAndApply.validatePatternMatchAndApply.validate_all
PatternMatchAndApplyRepeatedcollapse_multigraph_to_nx()enumerate_matches()get_transformation_metadata()match_patterns()type_match()type_or_class_match()
- dace.transformation.optimizer module
- dace.transformation.testing module
- Module contents
- Subpackages
- dace.optimization package
- Tuning APIs
AutoTunerCutoutTunerCutoutTuner.apply()CutoutTuner.config_from_key()CutoutTuner.cutouts()CutoutTuner.dry_run()CutoutTuner.evaluate()CutoutTuner.file_name()CutoutTuner.measure()CutoutTuner.optimize()CutoutTuner.pre_evaluate()CutoutTuner.search()CutoutTuner.space()CutoutTuner.taskCutoutTuner.top_k_configs()CutoutTuner.try_load()
tqdm()DistributedCutoutTunerDistributedSpaceTunertqdm()
- Auto-Tuners
- Utilities
- Module contents
- Tuning APIs
Submodules
dace.config module
- class dace.config.Config
Bases:
objectInterface to the DaCe hierarchical configuration file.
- static append(*key_hierarchy, value=None, autosave=False)
Appends to the current value of a given configuration entry and sets it.
- Parameters:
key_hierarchy – A tuple of strings leading to the configuration entry. For example: (‘a’, ‘b’, ‘c’) would be configuration entry c which is in the path a->b.
value – The value to append.
autosave – If True, saves the configuration to the file after modification.
- Returns:
Current configuration entry value.
Examples:
Config.append('compiler', 'cpu', 'args', value='-fPIC')
- static cfg_filename()
Returns the current configuration file path.
- default_filename = '.dace.conf'
- static get(*key_hierarchy)
Returns the current value of a given configuration entry.
- Parameters:
key_hierarchy – A tuple of strings leading to the configuration entry. For example: (‘a’, ‘b’, ‘c’) would be configuration entry c which is in the path a->b.
- Returns:
Configuration entry value.
- static get_bool(*key_hierarchy)
Returns the current value of a given boolean configuration entry. This specialization allows more string types to be converted to boolean, e.g., due to environment variable overrides.
- Parameters:
key_hierarchy – A tuple of strings leading to the configuration entry. For example: (‘a’, ‘b’, ‘c’) would be configuration entry c which is in the path a->b.
- Returns:
Configuration entry value (as a boolean).
- static get_default(*key_hierarchy)
Returns the default value of a given configuration entry. Takes into accound current operating system.
- Parameters:
key_hierarchy – A tuple of strings leading to the configuration entry. For example: (‘a’, ‘b’, ‘c’) would be configuration entry c which is in the path a->b.
- Returns:
Default configuration value.
- static get_metadata(*key_hierarchy)
Returns the configuration specification of a given entry from the schema.
- Parameters:
key_hierarchy – A tuple of strings leading to the configuration entry. For example: (‘a’, ‘b’, ‘c’) would be configuration entry c which is in the path a->b.
- Returns:
Configuration specification as a dictionary.
- static initialize()
Initializes configuration.
- Note:
This function runs automatically when the module is loaded.
- static load(filename=None)
Loads a configuration from an existing file.
- Parameters:
filename – The file to load. If unspecified, uses default configuration file.
- static load_schema(filename=None)
Loads a configuration schema from an existing file.
- Parameters:
filename – The file to load. If unspecified, uses default schema file.
- static nondefaults()
- Return type:
Dict[str,Any]
- static save(path=None, all=False)
Saves the current configuration to a file.
- Parameters:
path – The file to save to. If unspecified, uses default configuration file.
all (
bool) – If False, only saves non-default configuration entries. Otherwise saves all entries.
- static set(*key_hierarchy, value=None, autosave=False)
Sets the current value of a given configuration entry.
- Parameters:
key_hierarchy – A tuple of strings leading to the configuration entry. For example: (‘a’, ‘b’, ‘c’) would be configuration entry c which is in the path a->b.
value – The value to set.
autosave – If True, saves the configuration to the file after modification.
Examples:
Config.set('profiling', value=True)
- dace.config.set_temporary(*path, value)
Temporarily set configuration value at
pathto value, and reset it after the context manager exits.Example:
print(Config.get("compiler", "build_type") with set_temporary("compiler", "build_type", value="Debug"): print(Config.get("compiler", "build_type") print(Config.get("compiler", "build_type")
- dace.config.temporary_config()
Creates a context where all configuration options changed will be reset when the context exits.
Example:
with temporary_config(): Config.set("testing", "serialization", value=True) Config.set("optimizer", "autooptimize", value=True) foo()
dace.data module
- class dace.data.Array(*args, **kwargs)
Bases:
DataArray data descriptor. This object represents a multi-dimensional data container in SDFGs that can be accessed and modified. The definition does not contain the actual array, but rather a description of how to construct it and how it should behave.
The array definition is flexible in terms of data allocation, it allows arbitrary multidimensional, potentially symbolic shapes (e.g., an array with size
N+1 x Mwill haveshape=(N+1, M)), of arbitrary data typeclasses (dtype). The physical data layout of the array is controlled by several properties:The
stridesproperty determines the ordering and layout of the dimensions — it specifies how many elements in memory are skipped whenever one element in that dimension is advanced. For example, the contiguous dimension always has a stride of1; a C-style MxN array will have strides(N, 1), whereas a FORTRAN-style array of the same size will have(1, M). Strides can be larger than the shape, which allows post-padding of the contents of each dimension.The
start_offsetproperty is a number of elements to pad the beginning of the memory buffer with. This is used to ensure that a specific index is aligned as a form of pre-padding (that element may not necessarily be the first element, e.g., in the case of halo or “ghost cells” in stencils).The
total_sizeproperty determines how large the total allocation size is. Normally, it is the product of theshapeelements, but if pre- or post-padding is involved it may be larger.alignmentprovides alignment guarantees (in bytes) of the first element in the allocated array. This is used by allocators in the code generator to ensure certain addresses are expected to be aligned, e.g., for vectorization.Lastly, a property called
offsetcontrols the logical access of the array, i.e., what would be the first element’s index after padding and alignment. This mimics a language feature prominent in scientific languages such as FORTRAN, where one could set an array to begin with 1, or any arbitrary index. By default this is set to zero.
To summarize with an example, a two-dimensional array with pre- and post-padding looks as follows:
[xxx][ |xx] [ |xx] [ |xx] [ |xx] --------------- [xxxxxxxxxxxxx] shape = (4, 10) strides = (12, 1) start_offset = 3 total_size = 63 [= 3 + 12 * 5] offset = (0, 0, 0)Notice that the last padded row does not appear in strides, but is a consequence of
total_sizebeing larger.Apart from memory layout, other properties of
Arrayhelp the data-centric transformation infrastructure make decisions about the array.allow_conflictsstates that warnings should not be printed if potential conflicted acceses (e.g., data races) occur.may_aliasinhibits transformations that may assume that this array does not overlap with other arrays in the same context (e.g., function).- alignment
Allocation alignment in bytes (0 uses compiler-default)
- allow_conflicts
If enabled, allows more than one memlet to write to the same memory location without conflict resolution.
- as_arg(with_types=True, for_call=False, name=None)
Returns a string for a C++ function signature (e.g., int *A).
- clone()
- covers_range(rng)
- property free_symbols
Returns a set of undefined symbols in this data descriptor.
- classmethod from_json(json_obj, context=None)
- is_equivalent(other)
Check for equivalence (shape and type) of two data descriptors.
- may_alias
This pointer may alias with other pointers in the same function
- offset
Initial offset to translate all indices by.
- optional
Specifies whether this array may have a value of None. If False, the array must not be None. If option is not set, it is inferred by other properties and the OptionalArrayInference pass.
- pool
Hint to the allocator that using a memory pool is preferred
- properties()
- set_shape(new_shape, strides=None, total_size=None, offset=None)
Updates the shape of an array.
- sizes()
- start_offset
Allocation offset elements for manual alignment (pre-padding)
- strides
For each dimension, the number of elements to skip in order to obtain the next element in that dimension.
- to_json()
- total_size
The total allocated size of the array. Can be used for padding.
- validate()
Validate the correctness of this object. Raises an exception on error.
- class dace.data.Data(*args, **kwargs)
Bases:
objectData type descriptors that can be used as references to memory. Examples: Arrays, Streams, custom arrays (e.g., sparse matrices).
- as_arg(with_types=True, for_call=False, name=None)
Returns a string for a C++ function signature (e.g., int *A).
- property ctype
- debuginfo
Object property of type DebugInfo
- dtype
Object property of type typeclass
- property free_symbols: Set[Basic | SymExpr]
Returns a set of undefined symbols in this data descriptor.
- is_equivalent(other)
Check for equivalence (shape and type) of two data descriptors.
- lifetime
Data allocation span
- location
Full storage location identifier (e.g., rank, GPU ID)
- properties()
- set_strides_from_layout(*dimensions, alignment=1, only_first_aligned=False)
Sets the absolute strides and total size of this data descriptor, according to the given dimension ordering and alignment.
- Parameters:
dimensions (
int) – A sequence of integers representing a permutation of the descriptor’s dimensions.alignment (
Union[Basic,SymExpr]) – Padding (in elements) at the end, ensuring stride is a multiple of this number. 1 (default) means no padding.only_first_aligned (
bool) – If True, only the first dimension is padded withalignment. Otherwise all dimensions are.
- shape
Object property of type tuple
- storage
Storage location
- strides_from_layout(*dimensions, alignment=1, only_first_aligned=False)
Returns the absolute strides and total size of this data descriptor, according to the given dimension ordering and alignment.
- Parameters:
dimensions (
int) – A sequence of integers representing a permutation of the descriptor’s dimensions.alignment (
Union[Basic,SymExpr]) – Padding (in elements) at the end, ensuring stride is a multiple of this number. 1 (default) means no padding.only_first_aligned (
bool) – If True, only the first dimension is padded withalignment. Otherwise all dimensions are.
- Return type:
- Returns:
A 2-tuple of (tuple of strides, total size).
- to_json()
- property toplevel
- transient
Object property of type bool
- validate()
Validate the correctness of this object. Raises an exception on error.
- property veclen
- class dace.data.Reference(*args, **kwargs)
Bases:
ArrayData descriptor that acts as a dynamic reference of another array. It can be used just like a regular array, except that it could be set to an arbitrary array or sub-array at runtime. To set a reference, connect another access node to it and use the “set” connector.
In order to enable data-centric analysis and optimizations, avoid using References as much as possible.
- as_array()
- properties()
- validate()
Validate the correctness of this object. Raises an exception on error.
- class dace.data.Scalar(*args, **kwargs)
Bases:
DataData descriptor of a scalar value.
- allow_conflicts
Object property of type bool
- as_arg(with_types=True, for_call=False, name=None)
Returns a string for a C++ function signature (e.g., int *A).
- clone()
- covers_range(rng)
- static from_json(json_obj, context=None)
- is_equivalent(other)
Check for equivalence (shape and type) of two data descriptors.
- property may_alias: bool
- property offset
- property optional: bool
- property pool: bool
- properties()
- sizes()
- property start_offset
- property strides
- property total_size
- class dace.data.Stream(*args, **kwargs)
Bases:
DataStream (or stream array) data descriptor.
- as_arg(with_types=True, for_call=False, name=None)
Returns a string for a C++ function signature (e.g., int *A).
- buffer_size
Size of internal buffer.
- clone()
- covers_range(rng)
- property free_symbols
Returns a set of undefined symbols in this data descriptor.
- classmethod from_json(json_obj, context=None)
- is_equivalent(other)
Check for equivalence (shape and type) of two data descriptors.
- is_stream_array()
- property may_alias: bool
- offset
Object property of type list
- property optional: bool
- properties()
- size_string()
- sizes()
- property start_offset
- property strides
- to_json()
- property total_size
- class dace.data.View(*args, **kwargs)
Bases:
ArrayData descriptor that acts as a reference (or view) of another array. Can be used to reshape or reinterpret existing data without copying it.
To use a View, it needs to be referenced in an access node that is directly connected to another access node. The rules for deciding which access node is viewed are:
If there is one edge (in/out) that leads (via memlet path) to an access node, and the other side (out/in) has a different number of edges.
If there is one incoming and one outgoing edge, and one leads to a code node, the one that leads to an access node is the viewed data.
If both sides lead to access nodes, if one memlet’s data points to the view it cannot point to the viewed node.
If both memlets’ data are the respective access nodes, the access node at the highest scope is the one that is viewed.
If both access nodes reside in the same scope, the input data is viewed.
Other cases are ambiguous and will fail SDFG validation.
In the Python frontend,
numpy.reshapeandnumpy.ndarray.viewboth generate Views.- as_array()
- properties()
- validate()
Validate the correctness of this object. Raises an exception on error.
- dace.data.create_datadescriptor(obj, no_custom_desc=False)
Creates a data descriptor from various types of objects.
- See:
dace.data.Data
- dace.data.find_new_name(name, existing_names)
Returns a name that matches the given
nameas a prefix, but does not already exist in the given existing name set. The behavior is typically to append an underscore followed by a unique (increasing) number. If the name does not already exist in the set, it is returned as-is.- Parameters:
name (
str) – The given name to find.existing_names (
Sequence[str]) – The set of existing names.
- Return type:
str- Returns:
A new name that is not in existing_names.
- dace.data.make_array_from_descriptor(descriptor, original_array=None, symbols=None)
Creates an array that matches the given data descriptor, and optionally copies another array to it.
- Parameters:
descriptor (
Array) – The data descriptor to create the array from.original_array (
Union[_SupportsArray[dtype[Any]],_NestedSequence[_SupportsArray[dtype[Any]]],bool,int,float,complex,str,bytes,_NestedSequence[Union[bool,int,float,complex,str,bytes]],None]) – An optional array to fill the content of the return value with.symbols (
Optional[Dict[str,Any]]) – An optional symbol mapping between symbol names and their values. Used for creating arrays with symbolic sizes.
- Return type:
Union[_SupportsArray[dtype[Any]],_NestedSequence[_SupportsArray[dtype[Any]]],bool,int,float,complex,str,bytes,_NestedSequence[Union[bool,int,float,complex,str,bytes]]]- Returns:
A NumPy-compatible array (CuPy for GPU storage) with the specified size and strides.
- dace.data.make_reference_from_descriptor(descriptor, original_array, symbols=None)
Creates an array that matches the given data descriptor from the given pointer. Shares the memory with the argument (does not create a copy).
- Parameters:
descriptor (
Array) – The data descriptor to create the array from.original_array (
c_void_p) – The array whose memory the return value would be used in.symbols (
Optional[Dict[str,Any]]) – An optional symbol mapping between symbol names and their values. Used for referencing arrays with symbolic sizes.
- Return type:
Union[_SupportsArray[dtype[Any]],_NestedSequence[_SupportsArray[dtype[Any]]],bool,int,float,complex,str,bytes,_NestedSequence[Union[bool,int,float,complex,str,bytes]]]- Returns:
A NumPy-compatible array (CuPy for GPU storage) with the specified size and strides, sharing memory with the pointer specified in
original_array.
dace.dtypes module
A module that contains various DaCe type definitions.
- class dace.dtypes.AllocationLifetime(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
AutoNumberEnumOptions for allocation span (when to allocate/deallocate) of data.
- Global = 4
Allocated throughout the entire program (outer SDFG)
- Persistent = 5
Allocated throughout multiple invocations (init/exit)
- SDFG = 3
Allocated throughout the innermost SDFG (possibly nested)
- Scope = 1
Allocated/Deallocated on innermost scope start/end
- State = 2
Allocated throughout the containing state
- Undefined = 6
- register(*args)
- class dace.dtypes.DataInstrumentationType(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
AutoNumberEnumTypes of data container instrumentation providers.
- No_Instrumentation = 1
- Restore = 3
- Save = 2
- Undefined = 4
- register(*args)
- class dace.dtypes.DebugInfo(start_line, start_column=0, end_line=-1, end_column=0, filename=None)
Bases:
objectSource code location identifier of a node/edge in an SDFG. Used for IDE and debugging purposes.
- static from_json(json_obj, context=None)
- to_json()
- class dace.dtypes.DeviceType(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
AutoNumberEnumAn enumeration.
- CPU = 1
Multi-core CPU
- FPGA(Intel or Xilinx) = 3
FPGA (Intel or Xilinx)
- GPU(AMD or NVIDIA) = 2
GPU (AMD or NVIDIA)
- Snitch = 4
Compute Cluster (RISC-V)
- Undefined = 5
- register(*args)
- class dace.dtypes.InstrumentationType(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
AutoNumberEnumTypes of instrumentation providers.
- FPGA = 7
- GPU_Events = 6
- LIKWID_CPU = 4
- LIKWID_GPU = 5
- No_Instrumentation = 1
- PAPI_Counters = 3
- Timer = 2
- Undefined = 8
- register(*args)
- class dace.dtypes.Language(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
AutoNumberEnumAvailable programming languages for SDFG tasklets.
- CPP = 2
- MLIR = 5
- OpenCL = 3
- Python = 1
- SystemVerilog = 4
- Undefined = 6
- register(*args)
- class dace.dtypes.OMPScheduleType(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
AutoNumberEnumAvailable OpenMP shedule types for Maps with CPU-Multicore schedule.
- Default = 1
OpenMP library default
- Dynamic = 3
Dynamic schedule
- Guided = 4
Guided schedule
- Static = 2
Static schedule
- Undefined = 5
- register(*args)
- class dace.dtypes.ReductionType(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
AutoNumberEnumReduction types natively supported by the SDFG compiler.
- Bitwise_And = 7
Bitwise AND (&)
- Bitwise_Or = 9
Bitwise OR (|)
- Bitwise_Xor = 11
Bitwise XOR (^)
- Custom = 1
Defined by an arbitrary lambda function
- Div = 16
Division (only supported in OpenMP)
- Exchange = 14
Set new value, return old value
- Logical_And = 6
Logical AND (&&)
- Logical_Or = 8
Logical OR (||)
- Logical_Xor = 10
Logical XOR (!=)
- Max = 3
Maximum value
- Max_Location = 13
Maximum value and its location
- Min = 2
Minimum value
- Min_Location = 12
Minimum value and its location
- Product = 5
Product
- Sub = 15
Subtraction (only supported in OpenMP)
- Sum = 4
Sum
- Undefined = 17
- class dace.dtypes.ScheduleType(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
AutoNumberEnumAvailable map schedule types in the SDFG.
- CPU_Multicore = 4
OpenMP
- Default = 1
Scope-default parallel schedule
- FPGA_Device = 12
- FPGA_Multi_Pumped = 15
Used for double pumping
- GPU_Default = 7
Default scope schedule for GPU code. Specializes to schedule GPU_Device and GPU_Global during inference.
- GPU_Device = 8
Kernel
- GPU_Persistent = 11
- GPU_ThreadBlock = 9
Thread-block code
- GPU_ThreadBlock_Dynamic = 10
Allows rescheduling work within a block
- MPI = 3
MPI processes
- SVE_Map = 6
Arm SVE
- Sequential = 2
Sequential code (single-thread)
- Snitch = 13
- Snitch_Multicore = 14
- Undefined = 16
- Unrolled = 5
Unrolled code
- register(*args)
- class dace.dtypes.StorageType(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
AutoNumberEnumAvailable data storage types in the SDFG.
- CPU_Heap = 4
Host memory allocated on heap
- CPU_Pinned = 3
Host memory that can be DMA-accessed from accelerators
- CPU_ThreadLocal = 5
Thread-local host memory
- Default = 1
Scope-default storage location
- FPGA_Global = 8
Off-chip global memory (DRAM)
- FPGA_Local = 9
On-chip memory (bulk storage)
- FPGA_Registers = 10
On-chip memory (fully partitioned registers)
- FPGA_ShiftRegister = 11
Only accessible at constant indices
- GPU_Global = 6
GPU global memory
On-GPU shared memory
- Register = 2
Local data on registers, stack, or equivalent memory
- SVE_Register = 12
SVE register
- Snitch_L2 = 14
External memory
- Snitch_SSR = 15
Memory accessed by SSR streamer
- Snitch_TCDM = 13
Cluster-private memory
- Undefined = 16
- register(*args)
- class dace.dtypes.TilingType(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
AutoNumberEnumAvailable tiling types in a StripMining transformation.
- CeilRange = 2
- Normal = 1
- NumberOfTiles = 3
- Undefined = 4
- register(*args)
- class dace.dtypes.Typeclasses(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
AutoNumberEnumAn enumeration.
- Undefined = 16
- bool = 1
- bool_ = 2
- complex128 = 15
- complex64 = 14
- float16 = 11
- float32 = 12
- float64 = 13
- int16 = 4
- int32 = 5
- int64 = 6
- int8 = 3
- register(*args)
- uint16 = 8
- uint32 = 9
- uint64 = 10
- uint8 = 7
- class dace.dtypes.callback(return_types, *variadic_args)
Bases:
typeclassLooks like
dace.callback([None, <some_native_type>], *types)- as_arg(name)
- as_ctypes()
Returns the ctypes version of the typeclass.
- as_numpy_dtype()
- cfunc_return_type()
Returns the typeclass of the return value of the function call.
- Return type:
- static from_json(json_obj, context=None)
- get_trampoline(pyfunc, other_arguments, refs)
- is_scalar_function()
Returns True if the callback is a function that returns a scalar value (or nothing). Scalar functions are the only ones that can be used within a dace.tasklet explicitly.
- Return type:
bool
- to_json()
- dace.dtypes.can_access(schedule, storage)
Identifies whether a container of a storage type can be accessed in a specific schedule.
- dace.dtypes.can_allocate(storage, schedule)
Identifies whether a container of a storage type can be allocated in a specific schedule. Used to determine arguments to subgraphs by the innermost scope that a container can be allocated in. For example, FPGA_Global memory cannot be allocated from within the FPGA scope, or GPU shared memory cannot be allocated outside of device-level code.
- Parameters:
storage (
StorageType) – The storage type of the data container to allocate.schedule (
ScheduleType) – The scope schedule to query.
- Returns:
True if the container can be allocated, False otherwise.
- class dace.dtypes.compiletime
Bases:
objectData descriptor type hint signalling that argument evaluation is deferred to call time.
Example usage:
@dace.program def example(A: dace.float64[20], constant: dace.compiletime): if constant == 0: return A + 1 else: return A + 2
In the above code,
constantwill be replaced with its value at call time during parsing.
- dace.dtypes.deduplicate(iterable)
Removes duplicates in the passed iterable.
- dace.dtypes.is_array(obj)
Returns True if an object implements the
data_ptr(),__array_interface__or__cuda_array_interface__standards (supported by NumPy, Numba, CuPy, PyTorch, etc.). If the interface is supported, pointers can be directly obtained using the_array_interface_ptrfunction.- Parameters:
obj (
Any) – The given object.- Return type:
- Returns:
True iff the object implements the array interface.
- dace.dtypes.is_gpu_array(obj)
Returns True if an object is a GPU array, i.e., implements the
__cuda_array_interface__standard (supported by Numba, CuPy, PyTorch, etc.). If the interface is supported, pointers can be directly obtained using the_array_interface_ptrfunction.- Parameters:
obj (
Any) – The given object.- Return type:
- Returns:
True iff the object implements the CUDA array interface.
- dace.dtypes.isallowed(var, allow_recursive=False)
Returns True if a given object is allowed in a DaCe program.
- Parameters:
allow_recursive – whether to allow dicts or lists containing constants.
- dace.dtypes.isconstant(var)
Returns True if a variable is designated a constant (i.e., that can be directly generated in code).
- dace.dtypes.ismodule(var)
Returns True if a given object is a module.
- dace.dtypes.ismodule_and_allowed(var)
Returns True if a given object is a module and is one of the allowed modules in DaCe programs.
- dace.dtypes.ismoduleallowed(var)
Helper function to determine the source module of an object, and whether it is allowed in DaCe programs.
- dace.dtypes.json_to_typeclass(obj, context=None)
- dace.dtypes.max_value(dtype)
Get a max value literal for dtype.
- dace.dtypes.min_value(dtype)
Get a min value literal for dtype.
- class dace.dtypes.opaque(typename)
Bases:
typeclassA data type for an opaque object, useful for C bindings/libnodes, i.e., MPI_Request.
- as_ctypes()
Returns the ctypes version of the typeclass.
- as_numpy_dtype()
- static from_json(json_obj, context=None)
- to_json()
- dace.dtypes.paramdec(dec)
Parameterized decorator meta-decorator. Enables using @decorator, @decorator(), and @decorator(…) with the same function.
- class dace.dtypes.pointer(wrapped_typeclass)
Bases:
typeclassA data type for a pointer to an existing typeclass.
- Example use:
dace.pointer(dace.struct(x=dace.float32, y=dace.float32)).
- as_ctypes()
Returns the ctypes version of the typeclass.
- as_numpy_dtype()
- property base_type
- static from_json(json_obj, context=None)
- property ocltype
- to_json()
- dace.dtypes.ptrtocupy(ptr, inner_ctype, shape)
- dace.dtypes.ptrtonumpy(ptr, inner_ctype, shape)
- class dace.dtypes.pyobject
Bases:
opaqueA generic data type for Python objects in un-annotated callbacks. It cannot be used inside a DaCe program, but can be passed back to other Python callbacks. Use with caution, and ensure the value is not removed by the garbage collector or the program will crash.
- as_ctypes()
Returns the ctypes version of the typeclass.
- as_numpy_dtype()
- to_python(obj_id)
- dace.dtypes.reduction_identity(dtype, red)
Returns known identity values (which we can safely reset transients to) for built-in reduction types.
- Parameters:
dtype (
typeclass) – Input type.red (
ReductionType) – Reduction type.
- Return type:
Any- Returns:
Identity value in input type, or None if not found.
- dace.dtypes.result_type_of(lhs, *rhs)
Returns the largest between two or more types (dace.types.typeclass) according to C semantics.
- class dace.dtypes.stringtype
Bases:
pointerA specialization of the string data type to improve Python/generated code marshalling. Used internally when str types are given
- static from_json(json_obj, context=None)
- to_json()
- class dace.dtypes.struct(name, **fields_and_types)
Bases:
typeclassA data type for a struct of existing typeclasses.
Example use: dace.struct(a=dace.int32, b=dace.float64).
- as_ctypes()
Returns the ctypes version of the typeclass.
- as_numpy_dtype()
- emit_definition()
- property fields
- static from_json(json_obj, context=None)
- to_json()
- class dace.dtypes.typeclass(wrapped_type, typename=None)
Bases:
objectAn extension of types that enables their use in DaCe.
- These types are defined for three reasons:
Controlling DaCe types
Enabling declaration syntax: dace.float32[M,N]
Enabling extensions such as dace.struct and dace.vector
- as_arg(name)
- as_ctypes()
Returns the ctypes version of the typeclass.
- as_numpy_dtype()
- property base_type
- static from_json(json_obj, context=None)
- is_complex()
- property ocltype
- to_json()
- to_string()
A Numpy-like string-representation of the underlying data type.
- property veclen
- dace.dtypes.validate_name(name)
- class dace.dtypes.vector(dtype, vector_length)
Bases:
typeclassA data type for a vector-type of an existing typeclass.
Example use: dace.vector(dace.float32, 4) becomes float4.
- as_ctypes()
Returns the ctypes version of the typeclass.
- as_numpy_dtype()
- property base_type
- property ctype
- property ctype_unaligned
- static from_json(json_obj, context=None)
- property ocltype
- to_json()
- property veclen
dace.jupyter module
Jupyter Notebook support for DaCe.
- dace.jupyter.enable()
- dace.jupyter.isnotebook()
- dace.jupyter.preamble()
dace.library module
- dace.library.change_default(library, implementation)
- dace.library.environment(env)
- dace.library.expansion(exp)
- dace.library.get_environment(env_name)
- dace.library.get_environments_and_dependencies(names)
Get the environment objects from names. Also resolve the dependencies.
- Names:
set of environment names.
- Return type:
List- Returns:
a list of environment objects, ordered such that environments with dependencies appear after their dependencies.
- dace.library.get_library(lib_name)
- dace.library.node(n)
- dace.library.register_expansion(library_node, expansion_name)
Defines and registers an expansion.
- dace.library.register_implementation(implementation_name, expansion_cls, node_cls)
Associate a given library node expansion class with a library node class. This is done automatically for expansions defined in a DaCe library module, but this function can be used to add additional expansions from an external context.
- dace.library.register_library(module_name, name)
Called from a library’s __init__.py to register it with DaCe.
- dace.library.register_node(node_cls, library)
Associate a given library node class with a DaCe library. This is done automatically for library nodes defined in a DaCe library module, but this function can be used to add additional node classes from an external context.
- dace.library.register_transformation(transformation_cls, library)
Associate a given transformation with a DaCe library. This is done automatically for transformations defined in a DaCe library module, but this function can be used to add additional transformations from an external context.
dace.memlet module
- class dace.memlet.Memlet(*args, **kwargs)
Bases:
objectData movement object. Represents the data, the subset moved, and the manner it is reindexed (other_subset) into the destination. If there are multiple conflicting writes, this object also specifies how they are resolved with a lambda function.
- allow_oob
Bypass out-of-bounds validation
- bounding_box_size()
Returns a per-dimension upper bound on the maximum number of elements in each dimension.
This bound will be tight in the case of Range.
- data
Data descriptor attached to this memlet
- debuginfo
Line information to track source and generated code
- property dst_subset
- dynamic
Is the number of elements moved determined at runtime (e.g., data dependent)
- property free_symbols: Set[str]
Returns a set of symbols used in this edge’s properties.
- static from_array(dataname, datadesc, wcr=None)
Constructs a Memlet that transfers an entire array’s contents.
- Parameters:
dataname – The name of the data descriptor in the SDFG.
datadesc (Data) – The data descriptor object.
wcr – The conflict resolution lambda.
- static from_json(json_obj, context=None)
- get_dst_subset(edge, state)
- get_src_subset(edge, state)
- get_stride(sdfg, map, dim=-1)
Returns the stride of the underlying memory when traversing a Map.
- is_empty()
Returns True if this memlet carries no data. Memlets without data are primarily used for connecting nodes to scopes without transferring data to them.
- Return type:
bool
- property num_accesses
Returns the total memory movement volume (in elements) of this memlet.
- num_elements()
Returns the number of elements in the Memlet subset.
- other_subset
Subset of elements after reindexing to the data not attached to this edge (e.g., for offsets and reshaping).
- properties()
- replace(repl_dict)
Substitute a given set of symbols with a different set of symbols.
- Parameters:
repl_dict – A dict of string symbol names to symbols with which to replace them.
- static simple(data, subset_str, wcr_str=None, other_subset_str=None, wcr_conflict=True, num_accesses=None, debuginfo=None, dynamic=False)
DEPRECATED: Constructs a Memlet from string-based expressions.
- Parameters:
data – The data object or name to access.
subset_str – The subset of data that is going to be accessed in string format. Example: ‘0:N’.
wcr_str – A lambda function (as a string) specifying how write-conflicts are resolved. The syntax of the lambda function receives two elements: current value and new value, and returns the value after resolution. For example, summation is ‘lambda cur, new: cur + new’.
other_subset_str – The reindexing of subset on the other connected data (as a string).
wcr_conflict – If False, forces non-locked conflict resolution when generating code. The default is to let the code generator infer this information from the SDFG.
num_accesses – The number of times that the moved data will be subsequently accessed. If -1, designates that the number of accesses is unknown at compile time.
debuginfo – Source-code information (e.g., line, file) used for debugging.
dynamic – If True, the number of elements moved in this memlet is defined dynamically at runtime.
- property src_subset
- subset
Subset of elements to move from the data attached to this edge.
- to_json()
- try_initialize(sdfg, state, edge)
Tries to initialize the internal fields of the memlet (e.g., src/dst subset) once it is added to an SDFG as an edge.
- validate(sdfg, state)
- volume
The exact number of elements moved using this memlet, or the maximum number if dynamic=True (with 0 as unbounded)
- wcr
If set, defines a write-conflict resolution lambda function. The syntax of the lambda function receives two elements: current value and new value, and returns the value after resolution
- wcr_nonatomic
If True, always generates non-conflicting (non-atomic) writes in resulting code
- class dace.memlet.MemletTree(edge, downwards=True, parent=None, children=None)
Bases:
objectA tree of memlet edges.
Since memlets can form paths through scope nodes, and since these paths can split in “OUT_*” connectors, a memlet edge can be extended to a memlet tree. The tree is always rooted at the outermost-scope node, which can mean that it forms a tree of directed edges going forward (in the case where memlets go through scope-entry nodes) or backward (through scope-exit nodes).
Memlet trees can be used to obtain all edges pertaining to a single memlet using the memlet_tree function in SDFGState. This collects all siblings of the same edge and their children, for instance if multiple inputs from the same access node are used.
- property downwards
If True, this memlet tree points downwards (rooted at the source node).
- leaves()
Returns a list of all the leaves of this MemletTree, i.e., the innermost edges.
- Return type:
List[MultiConnectorEdge[Memlet]]
- root()
- Return type:
- traverse_children(include_self=False)
dace.properties module
- class dace.properties.CodeBlock(code, language=Language.Python)
Bases:
objectHelper class that represents code blocks with language. Used in CodeProperty, implemented as a list of AST statements if language is Python, or a string otherwise.
- property as_string: str
- static from_json(tmp, sdfg=None)
- get_free_symbols(defined_syms=None)
Returns the set of free symbol names in this code block, excluding the given symbol names.
- Return type:
Set[str]
- to_json()
- class dace.properties.CodeProperty(getter=None, setter=None, dtype=None, default=None, from_string=None, to_string=None, from_json=None, to_json=None, meta_to_json=None, choices=None, unmapped=False, allow_none=False, indirected=False, category='General', desc='', optional=False, optional_condition=<function Property.<lambda>>)
Bases:
PropertyCustom Property type that accepts code in various languages.
- property dtype
- from_json(tmp, sdfg=None)
- static from_string(string, language=None)
- to_json(obj)
- static to_string(obj)
- class dace.properties.DataProperty(desc='', default=None, **kwargs)
Bases:
PropertyCustom Property type that represents a link to a data descriptor. Needs the SDFG to be passed as an argument to from_string and choices.
- static choices(sdfg=None)
- from_json(s, context=None)
- static from_string(s, sdfg=None)
- to_json(obj)
- static to_string(obj)
- typestring()
- class dace.properties.DataclassProperty(getter=None, setter=None, dtype=None, default=None, from_string=None, to_string=None, from_json=None, to_json=None, meta_to_json=None, choices=None, unmapped=False, allow_none=False, indirected=False, category='General', desc='', optional=False, optional_condition=<function Property.<lambda>>)
Bases:
PropertyProperty that stores pydantic models or dataclasses.
- from_json(d, sdfg=None)
- static from_string(s)
- to_json(obj)
- static to_string(obj)
- class dace.properties.DebugInfoProperty(**kwargs)
Bases:
PropertyCustom Property type for DebugInfo members.
- property allow_none
- property dtype
- static from_string(s)
- static to_string(di)
- class dace.properties.DictProperty(key_type, value_type, *args, **kwargs)
Bases:
PropertyProperty type for dictionaries.
- from_json(data, sdfg=None)
- static from_string(s)
- to_json(d)
- static to_string(d)
- class dace.properties.LambdaProperty(getter=None, setter=None, dtype=None, default=None, from_string=None, to_string=None, from_json=None, to_json=None, meta_to_json=None, choices=None, unmapped=False, allow_none=False, indirected=False, category='General', desc='', optional=False, optional_condition=<function Property.<lambda>>)
Bases:
PropertyCustom Property type that accepts a lambda function, with conversions to and from strings.
- property dtype
- from_json(s, sdfg=None)
- static from_string(s)
- to_json(obj)
- static to_string(obj)
- class dace.properties.LibraryImplementationProperty(getter=None, setter=None, dtype=None, default=None, from_string=None, to_string=None, from_json=None, to_json=None, meta_to_json=None, choices=None, unmapped=False, allow_none=False, indirected=False, category='General', desc='', optional=False, optional_condition=<function Property.<lambda>>)
Bases:
PropertyProperty for choosing an implementation type for a library node. On the Python side it is a standard property, but can expand into a combo-box in the editor.
- typestring()
- class dace.properties.ListProperty(element_type, *args, **kwargs)
Bases:
Property[List[T]]Property type for lists.
- from_json(data, sdfg=None)
- from_string(s)
- to_json(l)
- static to_string(l)
- class dace.properties.OptionalSDFGReferenceProperty(getter=None, setter=None, dtype=None, default=None, from_string=None, to_string=None, from_json=None, to_json=None, meta_to_json=None, choices=None, unmapped=False, allow_none=False, indirected=False, category='General', desc='', optional=False, optional_condition=<function Property.<lambda>>)
Bases:
SDFGReferencePropertyAn SDFG reference property that defaults to None if cannot be deserialized.
- from_json(obj, context=None)
- class dace.properties.OrderedDictProperty(getter=None, setter=None, dtype=None, default=None, from_string=None, to_string=None, from_json=None, to_json=None, meta_to_json=None, choices=None, unmapped=False, allow_none=False, indirected=False, category='General', desc='', optional=False, optional_condition=<function Property.<lambda>>)
Bases:
PropertyProperty type for ordered dicts
- static from_json(obj, sdfg=None)
- to_json(d)
- class dace.properties.Property(getter=None, setter=None, dtype=None, default=None, from_string=None, to_string=None, from_json=None, to_json=None, meta_to_json=None, choices=None, unmapped=False, allow_none=False, indirected=False, category='General', desc='', optional=False, optional_condition=<function Property.<lambda>>)
Bases:
Generic[T]Class implementing properties of DaCe objects that conform to strong typing, and allow conversion to and from strings to be edited.
- static add_none_pair(dict_in)
- property allow_none
- property category
- property choices
- property default
- property desc
- property dtype
- property from_json
- property from_string
- static get_property_element(object_with_properties, name)
- property getter
- property indirected
- property meta_to_json
Returns a function to export meta information (type, description, default value).
- property optional
- property optional_condition
- property setter
- property to_json
- property to_string
- typestring()
- property unmapped
- exception dace.properties.PropertyError
Bases:
ExceptionException type for errors related to internal functionality of these properties.
- class dace.properties.RangeProperty(getter=None, setter=None, dtype=None, default=None, from_string=None, to_string=None, from_json=None, to_json=None, meta_to_json=None, choices=None, unmapped=False, allow_none=False, indirected=False, category='General', desc='', optional=False, optional_condition=<function Property.<lambda>>)
Bases:
PropertyCustom Property type for dace.subsets.Range members.
- property dtype
- static from_string(s)
- static to_string(obj)
- class dace.properties.ReferenceProperty(getter=None, setter=None, dtype=None, default=None, from_string=None, to_string=None, from_json=None, to_json=None, meta_to_json=None, choices=None, unmapped=False, allow_none=False, indirected=False, category='General', desc='', optional=False, optional_condition=<function Property.<lambda>>)
Bases:
PropertyCustom Property type that represents a link to another SDFG object. Needs the SDFG to be passed as an argument to from_string.
- static from_string(s, sdfg=None)
- static to_string(obj)
- class dace.properties.SDFGReferenceProperty(getter=None, setter=None, dtype=None, default=None, from_string=None, to_string=None, from_json=None, to_json=None, meta_to_json=None, choices=None, unmapped=False, allow_none=False, indirected=False, category='General', desc='', optional=False, optional_condition=<function Property.<lambda>>)
Bases:
Property- from_json(obj, context=None)
- to_json(obj)
- class dace.properties.SetProperty(element_type, getter=None, setter=None, default=None, from_string=None, to_string=None, from_json=None, to_json=None, unmapped=False, allow_none=False, desc='', **kwargs)
Bases:
PropertyProperty for a set of elements of one type, e.g., connectors.
- property dtype
- from_json(l, sdfg=None)
- static from_string(s)
- to_json(l)
- static to_string(l)
- class dace.properties.ShapeProperty(getter=None, setter=None, dtype=None, default=None, from_string=None, to_string=None, from_json=None, to_json=None, meta_to_json=None, choices=None, unmapped=False, allow_none=False, indirected=False, category='General', desc='', optional=False, optional_condition=<function Property.<lambda>>)
Bases:
PropertyCustom Property type that defines a shape.
- property dtype
- from_json(d, sdfg=None)
- static from_string(s)
- to_json(obj)
- static to_string(obj)
- class dace.properties.SubsetProperty(getter=None, setter=None, dtype=None, default=None, from_string=None, to_string=None, from_json=None, to_json=None, meta_to_json=None, choices=None, unmapped=False, allow_none=False, indirected=False, category='General', desc='', optional=False, optional_condition=<function Property.<lambda>>)
Bases:
PropertyCustom Property type that accepts any form of subset, and enables parsing strings into multiple types of subsets.
- property allow_none
- property dtype
- from_json(val, sdfg=None)
- static from_string(s)
- to_json(val)
- static to_string(val)
- class dace.properties.SymbolicProperty(getter=None, setter=None, dtype=None, default=None, from_string=None, to_string=None, from_json=None, to_json=None, meta_to_json=None, choices=None, unmapped=False, allow_none=False, indirected=False, category='General', desc='', optional=False, optional_condition=<function Property.<lambda>>)
Bases:
PropertyCustom Property type that accepts integers or Sympy expressions.
- property dtype
- static from_string(s)
- static to_string(obj)
- class dace.properties.TransformationHistProperty(*args, **kwargs)
Bases:
PropertyProperty type for transformation histories.
- from_json(data, sdfg=None)
- to_json(hist)
- class dace.properties.TypeClassProperty(getter=None, setter=None, dtype=None, default=None, from_string=None, to_string=None, from_json=None, to_json=None, meta_to_json=None, choices=None, unmapped=False, allow_none=False, indirected=False, category='General', desc='', optional=False, optional_condition=<function Property.<lambda>>)
Bases:
PropertyCustom property type for memory as defined in dace.types, e.g. dace.float32.
- property dtype
- static from_json(obj, context=None)
- static from_string(s)
- to_json(obj)
- static to_string(obj)
- class dace.properties.TypeProperty(getter=None, setter=None, dtype=None, default=None, from_string=None, to_string=None, from_json=None, to_json=None, meta_to_json=None, choices=None, unmapped=False, allow_none=False, indirected=False, category='General', desc='', optional=False, optional_condition=<function Property.<lambda>>)
Bases:
PropertyCustom Property type that finds a type according to the input string.
- property dtype
- static from_json(obj, context=None)
- static from_string(s)
- dace.properties.indirect_properties(indirect_class, indirect_function, override=False)
A decorator for objects that provides indirect properties defined in another class.
- dace.properties.indirect_property(cls, f, prop, override)
- dace.properties.make_properties(cls)
A decorator for objects that adds support and checks for strongly-typed properties (which use the Property class).
- dace.properties.set_property_from_string(prop, obj, string, sdfg=None, from_json=False)
Interface function that guarantees that a property will always be correctly set, if possible, by accepting all possible input arguments to from_string.
dace.serialize module
- class dace.serialize.NumpySerializer
Bases:
objectHelper class to load/store numpy arrays from JSON.
- static from_json(json_obj, context=None)
- static to_json(obj)
- class dace.serialize.SerializableObject(json_obj={}, typename=None)
Bases:
object- static from_json(json_obj, context=None, typename=None)
- json_obj = {}
- to_json()
- typename = None
- dace.serialize.all_properties_to_json(object_with_properties)
- dace.serialize.dump(*args, **kwargs)
- dace.serialize.dumps(*args, **kwargs)
- dace.serialize.from_json(obj, context=None, known_type=None)
- dace.serialize.get_serializer(type_name)
- dace.serialize.load(*args, context=None, **kwargs)
- dace.serialize.loads(*args, context=None, **kwargs)
- dace.serialize.serializable(cls)
- dace.serialize.set_properties_from_json(object_with_properties, json_obj, context=None, ignore_properties=None)
- dace.serialize.to_json(obj)
dace.sourcemap module
- class dace.sourcemap.MapCpp(code, name, target_name)
Bases:
objectCreates the mapping between the SDFG nodes and the generated C++ code lines.
- codegen_mapping(line, line_num)
Searches the code line for the first
////__CODEGENidentifier and adds the information to the codegen_map- Parameters:
line (
str) – code line to search for identifiersline_num (
int) – corresponding line number
- create_mapping(node, line_num)
Adds a C++ line number to the mapping
- Parameters:
node (
SdfgLocation) – A node which will map to the line numberline_num (
int) – The line number to add to the mapping
- get_identifiers(line, findall=True)
Returns a list of identifiers found in the code line
- Parameters:
line (
str) – line of C++ code with identifiersfindall (
bool) – if it should return all finds or just the first one
- Returns:
if
findallis True, returns list of identifiers, otherwise a single identifier.
- get_nodes(line_code)
Retrieve all identifiers set at the end of the line of code. Example:
x = y ////__DACE:0:0:0 ////__DACE:0:0:1returns[SDFGL(0,0,0), SDFGL(0,0,1)]- Parameters:
line_code (
str) – a single line of code- Returns:
list of SDFGLocation
- mapper(codegen_debug=False)
For each line of code retrieve the corresponding identifiers and create the mapping
- Parameters:
codegen_debug (
bool) – if the codegen mapping should be created
- class dace.sourcemap.MapPython(name)
Bases:
objectCreates the mapping between the source code and the SDFG nodes
- create_mapping(range_dict=None)
Creates the actual mapping by using the debuginfo list
- Parameters:
range_dict – For each file, a list of tuples containing a start and end line of a DaCe program
- divide()
Divide debuginfo into an array where each entry corresponds to the debuginfo of a diffrent sourcefile.
- make_info(debuginfo, node_id, state_id, sdfg_id)
Creates an object for the current node with the most important information
- Parameters:
debuginfo – JSON object of the debuginfo of the node
node_id (
int) – ID of the nodestate_id (
int) – ID of the statesdfg_id (
int) – ID of the sdfg
- Return type:
dict- Returns:
Dictionary with a debuginfo JSON object and the identifiers
- mapper(sdfg)
Creates the source to SDFG node mapping
- Parameters:
sdfg – SDFG to create the mapping for
- Return type:
bool- Returns:
if the sdfg was created only by the API
- sdfg_debuginfo(graph, sdfg_id=0, state_id=0)
Recursively retracts all debuginfo from the nodes
- Parameters:
graph – An SDFG or SDFGState to check for nodes
sdfg_id (
int) – Id of the current SDFG/NestedSDFGstate_id (
int) – Id of the current SDFGState
- Returns:
list of debuginfo with the node identifiers
- sorter()
Prioritizes smaller ranges over larger ones
- dace.sourcemap.create_cache(name, folder)
Creates the map folder in the build path if it does not yet exist
- Parameters:
name (
str) – name of the SDFGfolder (
str) – the build folder
- Return type:
str- Returns:
relative path to the created folder
- dace.sourcemap.create_cpp_map(code, name, target_name, build_folder, sourceFiles, made_with_api)
Creates the mapping from the SDFG nodes to the C++ code lines. The mapping gets saved at:
<SDFG build folder>/map/map_cpp.json- Parameters:
code (
str) – C++ code containing the identifiers ‘////__DACE:0:0:0’name (
str) – The name of the SDFGtarget_name (
str) – The target type, example: ‘cpu’build_folder (
str) – The build_folder of the SDFGsourceFiles ([<class 'str'>]) – A list of source files of to the SDFG
made_with_api (
bool) – true if the SDFG was created just with the API
- dace.sourcemap.create_folder(path_str)
Creates a folder if it does not yet exist
- Parameters:
path_str (
str) – location the folder will be crated at
- dace.sourcemap.create_maps(sdfg, code, target_name)
Creates the C++, Py and Codegen mapping
- Parameters:
sdfg – The sdfg to create the mapping for
code (
str) – The generated codetarget_name (
str) – The target name
- dace.sourcemap.create_py_map(sdfg)
Creates the mapping from the python source lines to the SDFG nodes. The mapping gets saved at:
<SDFG build folder>/map/map_py.json- Parameters:
sdfg – The SDFG for which the mapping will be created
- Returns:
an object with the build_folder, src_files and made_with_api
- dace.sourcemap.get_src_files(sdfg)
Search all nodes for debuginfo to find the source filenames
- Parameters:
sdfg – An SDFG to check for source files
- Returns:
list of unique source filenames
- dace.sourcemap.save(language, name, map, build_folder)
Saves the mapping in the map folder of the corresponding SDFG
- Parameters:
language (
str) – used for the file name to save to: py -> map_py.jsonname (
str) – name of the SDFGmap (
dict) – the map object to be savedbuild_folder (
str) – build folder
- Return type:
str- Returns:
absolute path to the cache folder of the SDFG
- dace.sourcemap.send(data)
Sends a json object to the port given as the env variable DACE_port. If the port isn’t set we don’t send anything.
- Parameters:
data (<module 'json' from '/home/docs/.asdf/installs/python/3.9.15/lib/python3.9/json/__init__.py'>) – json object to send
dace.subsets module
- class dace.subsets.Indices(indices)
Bases:
SubsetA subset of one element representing a single index in an N-dimensional data descriptor.
- absolute_strides(global_shape)
- at(i, strides)
Returns the absolute index (1D memory layout) of this subset at the given index tuple. For example, the range [2:10::2] at index 2 would return 6 (2+2*2).
- Parameters:
i – A tuple of the same dimensionality as subset.dims().
strides – The strides of the array we are subsetting.
- Returns:
Absolute 1D index at coordinate i.
- bounding_box_size()
- compose(other)
- coord_at(i)
Returns the offseted coordinates of this subset at the given index tuple. For example, the range [2:10:2] at index 2 would return 6 (2+2*2).
- Parameters:
i – A tuple of the same dimensionality as subset.dims().
- Returns:
Absolute coordinates for index i.
- data_dims()
- dims()
- property free_symbols: Set[str]
Returns a set of undefined symbols in this subset.
- static from_json(obj, context=None)
- static from_string(s)
- intersection(other)
- intersects(other)
- max_element()
- max_element_approx()
- min_element()
- min_element_approx()
- ndrange()
- num_elements()
- num_elements_exact()
- offset(other, negative, indices=None)
- offset_new(other, negative, indices=None)
- pop(dimensions)
- pystr()
- reorder(order)
Re-orders the dimensions in-place according to a permutation list.
- Parameters:
order – List or tuple of integers from 0 to self.dims() - 1, indicating the desired order of the dimensions.
- replace(repl_dict)
- size()
- size_exact()
- squeeze(ignore_indices=None)
- strides()
- to_json()
- unsqueeze(axes)
Adds zeroes to the subset, in the indices contained in axes.
The method is mostly used to restore subsets that had their zero-indices removed (i.e., squeezed subsets). Hence, the method is called ‘unsqueeze’.
Examples (initial subset, axes -> result subset, output): - [i], [0] -> [0, i], [0] - [i], [0, 1] -> [0, 0, i], [0, 1] - [i], [0, 2] -> [0, i, 0], [0, 2] - [i], [0, 1, 2, 3] -> [0, 0, 0, 0, i], [0, 1, 2, 3] - [i], [0, 2, 3, 4] -> [0, i, 0, 0, 0], [0, 2, 3, 4] - [i], [0, 1, 1] -> [0, 0, 0, i], [0, 1, 2]
- Parameters:
axes (
Sequence[int]) – The axes where the zero-indices should be added.- Return type:
List[int]- Returns:
A list of the actual axes where the zero-indices were added.
- class dace.subsets.Range(ranges)
Bases:
SubsetSubset defined in terms of a fixed range.
- absolute_strides(global_shape)
Returns a list of strides for advancing one element in each dimension. Size of the list is equal to data_dims(), which may be larger than dims() depending on tile sizes.
- at(i, strides)
Returns the absolute index (1D memory layout) of this subset at the given index tuple.
For example, the range [2:10:2] at index 2 would return 6 (2+2*2).
- Parameters:
i – A tuple of the same dimensionality as subset.dims() or subset.data_dims().
strides – The strides of the array we are subsetting.
- Returns:
Absolute 1D index at coordinate i.
- bounding_box_size()
Returns the size of a bounding box around this range.
- compose(other)
- coord_at(i)
Returns the offseted coordinates of this subset at the given index tuple.
For example, the range [2:10:2] at index 2 would return 6 (2+2*2).
- Parameters:
i – A tuple of the same dimensionality as subset.dims() or subset.data_dims().
- Returns:
Absolute coordinates for index i (length equal to data_dims(), may be larger than dims()).
- data_dims()
- static dim_to_string(d, t=1)
- dims()
- property free_symbols: Set[str]
Returns a set of undefined symbols in this subset.
- static from_array(array)
Constructs a range that covers the full array given as input.
- static from_indices(indices)
- static from_json(obj, context=None)
- static from_string(string)
- intersects(other)
- max_element()
- max_element_approx()
- min_element()
- min_element_approx()
- ndrange()
- static ndslice_to_string(slice, tile_sizes=None)
- static ndslice_to_string_list(slice, tile_sizes=None)
- num_elements()
- num_elements_exact()
- offset(other, negative, indices=None)
- offset_new(other, negative, indices=None)
- pop(dimensions)
- pystr()
- reorder(order)
Re-orders the dimensions in-place according to a permutation list.
- Parameters:
order – List or tuple of integers from 0 to self.dims() - 1, indicating the desired order of the dimensions.
- replace(repl_dict)
- size(for_codegen=False)
Returns the number of elements in each dimension.
- size_exact()
Returns the number of elements in each dimension.
- squeeze(ignore_indices=None, offset=True)
- strides()
- string_list()
- to_json()
- unsqueeze(axes)
Adds 0:1 ranges to the subset, in the indices contained in axes.
The method is mostly used to restore subsets that had their length-1 ranges removed (i.e., squeezed subsets). Hence, the method is called ‘unsqueeze’.
Examples (initial subset, axes -> result subset, output): - [i:i+10], [0] -> [0:1, i], [0] - [i:i+10], [0, 1] -> [0:1, 0:1, i:i+10], [0, 1] - [i:i+10], [0, 2] -> [0:1, i:i+10, 0:1], [0, 2] - [i:i+10], [0, 1, 2, 3] -> [0:1, 0:1, 0:1, 0:1, i:i+10], [0, 1, 2, 3] - [i:i+10], [0, 2, 3, 4] -> [0:1, i:i+10, 0:1, 0:1, 0:1], [0, 2, 3, 4] - [i:i+10], [0, 1, 1] -> [0:1, 0:1, 0:1, i:i+10], [0:1, 1, 2]
- Parameters:
axes (
Sequence[int]) – The axes where the 0:1 ranges should be added.- Return type:
List[int]- Returns:
A list of the actual axes where the 0:1 ranges were added.
- class dace.subsets.Subset
Bases:
objectDefines a subset of a data descriptor.
- at(i, strides)
Returns the absolute index (1D memory layout) of this subset at the given index tuple.
For example, the range [2:10:2] at index 2 would return 6 (2+2*2).
- Parameters:
i – A tuple of the same dimensionality as subset.dims() or subset.data_dims().
strides – The strides of the array we are subsetting.
- Returns:
Absolute 1D index at coordinate i.
- coord_at(i)
Returns the offseted coordinates of this subset at the given index tuple.
For example, the range [2:10:2] at index 2 would return 6 (2+2*2).
- Parameters:
i – A tuple of the same dimensionality as subset.dims() or subset.data_dims().
- Returns:
Absolute coordinates for index i (length equal to data_dims(), may be larger than dims()).
- covers(other)
Returns True if this subset covers (using a bounding box) another subset.
- property free_symbols: Set[str]
Returns a set of undefined symbols in this subset.
- offset(other, negative, indices=None)
- offset_new(other, negative, indices=None)
- dace.subsets.bounding_box_union(subset_a, subset_b)
Perform union by creating a bounding-box of two subsets.
- Return type:
- dace.subsets.intersects(subset_a, subset_b)
Returns True if two subsets intersect, False if they do not, or None if the answer cannot be determined.
- dace.subsets.union(subset_a, subset_b)
Compute the union of two Subset objects. If the subsets are not of the same type, degenerates to bounding-box union.
dace.symbolic module
- class dace.symbolic.AND(x, y)
Bases:
Function- default_assumptions = {}
- classmethod eval(x, y)
Evaluates logical and.
- Parameters:
x – First operand.
y – Second operand.
- Returns:
Return value (literal or symbolic).
- class dace.symbolic.BitwiseOpConverter
Bases:
NodeTransformerReplaces C/C++ bitwise operations with functions to avoid sympification to boolean operations.
- visit_BinOp(node)
- visit_UnaryOp(node)
- class dace.symbolic.DaceSympyPrinter(arrays, *args, **kwargs)
Bases:
StrPrinterSeveral notational corrections for integer math and C++ translation that sympy.printing.cxxcode does not provide.
- class dace.symbolic.OR(x, y)
Bases:
Function- default_assumptions = {}
- classmethod eval(x, y)
Evaluates logical or.
- Parameters:
x – First operand.
y – Second operand.
- Returns:
Return value (literal or symbolic).
- class dace.symbolic.ROUND(x)
Bases:
Function- default_assumptions = {}
- classmethod eval(x)
Evaluates rounding to integer.
- Parameters:
x – Value to round.
- Returns:
Return value (literal or symbolic).
- class dace.symbolic.SymExpr(main_expr, approx_expr=None)
Bases:
objectSymbolic expressions with support for an overapproximation expression.
- property approx
- property expr
- match(*args, **kwargs)
- subs(repldict)
- class dace.symbolic.SympyAwarePickler(file, protocol=None, fix_imports=True, buffer_callback=None)
Bases:
PicklerCustom Pickler class that safely saves SymPy expressions with function definitions in expressions (e.g., int_ceil).
- persistent_id(obj)
- class dace.symbolic.SympyAwareUnpickler(file, *, fix_imports=True, encoding='ASCII', errors='strict', buffers=())
Bases:
UnpicklerCustom Unpickler class that safely restores SymPy expressions with function definitions in expressions (e.g., int_ceil).
- persistent_load(pid)
- class dace.symbolic.SympyBooleanConverter
Bases:
NodeTransformerReplaces boolean operations with the appropriate SymPy functions to avoid non-symbolic evaluation.
- visit_BoolOp(node)
- visit_Compare(node)
- visit_Constant(node)
- visit_NameConstant(node)
- visit_UnaryOp(node)
- dace.symbolic.contains_sympy_functions(expr)
Returns True if expression contains Sympy functions.
- dace.symbolic.equalize_symbol(sym)
If a symbol or symbolic expressions has multiple symbols with the same name, it substitutes them with the last symbol (as they appear in s.free_symbols).
- Return type:
Expr
- dace.symbolic.equalize_symbols(a, b)
If the 2 input expressions use different symbols but with the same name, it substitutes the symbols of the second expressions with those of the first expression.
- Return type:
Tuple[Expr,Expr]
- dace.symbolic.evaluate(expr, symbols)
Evaluates an expression to a constant based on a mapping from symbols to values.
- Parameters:
expr (
Union[Basic,int,float]) – The expression to evaluate.symbols (
Dict[Union[symbol,str],Union[int,float]]) – A mapping of symbols to their values.
- Return type:
Union[int,float,number]- Returns:
A constant value based on
exprandsymbols.
- dace.symbolic.evaluate_optional_arrays(expr, sdfg)
Evaluate Is(…) and IsNot(…) expressions for arrays.
- Parameters:
expr – The symbolic expression to evaluate.
sdfg – SDFG that contains arrays.
- Returns:
A simplified version of the expression.
- dace.symbolic.free_symbols_and_functions(expr)
- Return type:
Set[str]
- dace.symbolic.inequal_symbols(a, b)
Compares 2 symbolic expressions and returns True if they are not equal.
- Return type:
bool
- class dace.symbolic.int_ceil(x, y)
Bases:
Function- default_assumptions = {}
- classmethod eval(x, y)
Evaluates integer ceiling division (
ceil(x / y)).- Parameters:
x – Numerator.
y – Denominator.
- Returns:
Return value (literal or symbolic).
- class dace.symbolic.int_floor(x, y)
Bases:
Function- default_assumptions = {}
- classmethod eval(x, y)
Evaluates integer floor division (
floor(x / y)).- Parameters:
x – Numerator.
y – Denominator.
- Returns:
Return value (literal or symbolic).
- dace.symbolic.is_sympy_userfunction(expr)
Returns True if the expression is a SymPy function.
- dace.symbolic.issymbolic(value, constants=None)
Returns True if an expression is symbolic with respect to its contents and a given dictionary of constant values.
- dace.symbolic.overapproximate(expr)
Takes a sympy expression and returns its maximal possible value in specific cases.
- dace.symbolic.pystr_to_symbolic(expr, symbol_map=None, simplify=None)
Takes a Python string and converts it into a symbolic expression.
- Return type:
Basic
- dace.symbolic.resolve_symbol_to_constant(symb, start_sdfg)
Tries to resolve a symbol to constant, by looking up into SDFG’s constants, following nested SDFGs hierarchy if necessary.
- Parameters:
symb – symbol to resolve to constant
start_sdfg – starting SDFG
- Returns:
the constant value if the symbol is resolved, None otherwise
- dace.symbolic.safe_replace(mapping, replace_callback, value_as_string=False)
Safely replaces symbolic expressions that may clash with each other via a two-step replacement. For example, the mapping
{M: N, N: M}would be translated to replacing{N, M} -> __dacesym_{N, M}followed by__dacesym{N, M} -> {M, N}.- Parameters:
mapping (
Dict[Union[Basic,SymExpr,str],Union[Basic,SymExpr,str]]) – The replacement dictionary.replace_callback (
Callable[[Dict[str,str]],None]) – A callable function that receives a replacement dictionary and performs the replacement (can be unsafe).value_as_string (
bool) – Replacement values are replaced as strings rather than symbols.
- Return type:
None
- dace.symbolic.simplify_ext(expr)
An extended version of simplification with expression fixes for sympy.
- Parameters:
expr – A sympy expression.
- Returns:
Simplified version of the expression.
- dace.symbolic.swalk(expr, enter_functions=False)
Walk over a symbolic expression tree (similar to ast.walk). Returns an iterator that yields the values and recurses into functions, if specified.
- class dace.symbolic.symbol(name=None, dtype=int, **assumptions)
Bases:
SymbolDefines a symbolic expression. Extends SymPy symbols with DaCe-related information.
- add_constraints(constraint_list)
- check_constraints(value)
- property constraints
- default_assumptions = {}
- get()
- get_or_return(uninitialized_ret)
- is_initialized()
- name
- s_currentsymbol = 0
- set(value)
- set_constraints(constraint_list)
- dace.symbolic.symbol_name_or_value(val)
Returns the symbol name if symbol, otherwise the value as a string.
- dace.symbolic.symbols_in_ast(tree)
Walks an AST and finds all names, excluding function names.
- dace.symbolic.symlist(values)
Finds symbol dependencies of expressions.
- dace.symbolic.sympy_divide_fix(expr)
Fix SymPy printouts where integer division such as “tid/2” turns into “.5*tid”.
- dace.symbolic.sympy_intdiv_fix(expr)
Fix for SymPy printing out reciprocal values when they should be integral in “ceiling/floor” sympy functions.
- dace.symbolic.sympy_numeric_fix(expr)
Fix for printing out integers as floats with “.00000000”. Converts the float constants in a given expression to integers.
- dace.symbolic.sympy_to_dace(exprs, symbol_map=None)
Convert all sympy.Symbol`s to DaCe symbols, according to `symbol_map.
- dace.symbolic.symstr(sym, arrayexprs=None)
Convert a symbolic expression to a C++ compilable expression.
- Parameters:
sym – Symbolic expression to convert.
arrayexprs (
Optional[Set[str]]) – Set of names of arrays, used to convert SymPy user-functions back to array expressions.
- Return type:
str- Returns:
C++-compilable expression.
- dace.symbolic.symtype(expr)
Returns the inferred symbol type from a symbolic expression.
- dace.symbolic.symvalue(val)
Returns the symbol value if it is a symbol.
Module contents
- class dace.DaceModule(name, doc=None)
Bases:
module