78 const std::string& kernel_name,
81 std::vector<std::string>& arguments_device
93 codegen::PrettyPrinter& stream,
const std::string& kernel_name, std::vector<std::string>& arguments_declaration
108 bool declare_scope_variables,
109 std::vector<std::string>& scope_variables
Definition structured_sdfg.h:30
Definition arg_capture_plan.h:36
Originally started out as a handler for additional source files, like hardware-accelerator kernels th...
Definition code_snippet_factory.h:69
Definition instrumentation_info.h:37
Definition instrumentation_plan.h:26
Definition language_extension.h:39
Base class for dispatching control flow nodes to code.
Definition node_dispatcher.h:41
virtual codegen::TargetType target_type() const =0
Target type used for instrumentation info.
virtual void emit_kernel_includes(codegen::CodeSnippetFactory &library_snippet_factory) const =0
Emit the backend include directives required by the generated kernel.
virtual void emit_library_preamble(codegen::PrettyPrinter &library_stream) const =0
Emit any extra preamble at the top of the kernel translation unit.
void dispatch_node(codegen::PrettyPrinter &main_stream, codegen::PrettyPrinter &globals_stream, codegen::CodeSnippetFactory &library_snippet_factory) override
void dispatch_atomic_merge(codegen::PrettyPrinter &library_stream, codegen::CodeSnippetFactory &library_snippet_factory, const structured_control_flow::ReductionInfo &reduction)
Emit the device-side helper(s) and the atomic merge statement that combines a thread's private partia...
virtual void emit_kernel_call(codegen::PrettyPrinter &main_stream, const std::string &kernel_name, symbolic::Expression &num_blocks, symbolic::Expression &block_size, std::vector< std::string > &arguments_device)=0
Emit the host-side kernel launch.
virtual bool is_device_pointer_storage(const types::StorageType &storage) const =0
True if storage designates a device-resident generic pointer for this backend.
virtual std::string schedule_value() const =0
Schedule value string identifying this backend's GPU schedule ("CUDA"/"ROCM").
virtual std::string kernel_file_extension() const =0
File extension for the kernel translation unit ("cu"/"rocm.cpp").
virtual std::unique_ptr< codegen::LanguageExtension > create_device_language_extension() const =0
Create the backend device-code language extension (CUDA/HIP).
void dispatch_reduce_core(codegen::CodeSnippetFactory &library_snippet_factory, codegen::PrettyPrinter &library_stream, GPUDimension dimension, bool declare_scope_variables, std::vector< std::string > &scope_variables)
Emit the privatize + grid-stride reduce loop + atomic merge into the given (device) stream,...
GPUReduceDispatcher(codegen::LanguageExtension &language_extension, StructuredSDFG &sdfg, analysis::AnalysisManager &analysis_manager, structured_control_flow::Reduce &node, codegen::InstrumentationPlan &instrumentation_plan, codegen::ArgCapturePlan &arg_capture_plan)
structured_control_flow::Reduce & node_
Definition gpu_reduce_dispatcher.h:50
bool is_nested_in_gpu_kernel()
True if this Reduce is nested inside an enclosing GPU kernel (an ancestor Map with this backend's GPU...
codegen::InstrumentationInfo instrumentation_info() const override
Bad design.
void dispatch_header(codegen::PrettyPrinter &stream, const std::string &kernel_name, std::vector< std::string > &arguments_declaration)
Represents a loop with an associative/commutative reduction carried dependency.
Definition reduce.h:106
Represents the storage location and management characteristics of data.
Definition type.h:64
SymEngine::RCP< const SymEngine::Basic > Expression
Reference-counted pointer to a symbolic expression (SymEngine Basic).
Definition symbolic.h:83
StringEnum TargetType
Definition instrumentation_info.h:32
Definition cuda_arch.h:11
GPUDimension
Shared GPU dimension enum for CUDA/ROCm targets Represents the X, Y, Z dimensions used for GPU kernel...
Definition gpu_types.h:10
Dispatcher base class for code generation from control flow nodes.
A single reduction carried by a Reduce loop.
Definition reduce.h:73
Symbolic system for integer-based symbol analysis.
Core type system definitions for sdfglib.