docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
cuda_offload_dispatcher_strategy.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <vector>
5
10
11
12namespace sdfg {
13namespace cuda {
14
22public:
24 codegen::PrettyPrinter& main_stream,
25 const std::string& kernel_name,
26 codegen::LanguageExtension& host_language_ext,
27 symbolic::Expression& num_blocks_x,
28 symbolic::Expression& num_blocks_y,
29 symbolic::Expression& num_blocks_z,
30 symbolic::Expression& block_size_x,
31 symbolic::Expression& block_size_y,
32 symbolic::Expression& block_size_z,
33 std::vector<std::string>& arguments_device
34 ) override;
35
36 void emit_target_header_declarations(codegen::PrettyPrinter& kernel_header_stream) override;
37 void emit_target_global_includes(codegen::CodeSnippetFactory& library_snippet_factory) override;
38
40
42 codegen::PrettyPrinter& stream, const codegen::LanguageExtension& language_extension
43 );
44
45 int get_warp_size() const override;
46
47 bool is_device_pointer_storage(const types::StorageType& storage) const override;
48
49 constexpr static const char* KERNEL_SNIPPET_FILE_EXT = "cu";
50 constexpr static const char* KERNEL_SNIPPET_HEADER_EXT = "cu.h";
51
52 std::string kernel_file_extension() const override;
53 std::string kernel_header_file_extension() const override;
54
55 std::string warp_shuffle_xor(const std::string& value, const std::string& lane_mask) const override;
56
58
59 std::unique_ptr<codegen::LanguageExtension>
61
63 const StructuredSDFG& sdfg, const StructuredLoop& loop, codegen::LanguageExtension& language_extension
64 ) override;
65};
66
67} // namespace cuda
68} // namespace sdfg
Definition structured_sdfg.h:30
Originally started out as a handler for additional source files, like hardware-accelerator kernels th...
Definition code_snippet_factory.h:69
Definition language_extension.h:39
Definition utils.h:16
std::string kernel_header_file_extension() const override
File extension for the kernel's include header ("cu.h"/"rocm.h").
void emit_target_global_includes(codegen::CodeSnippetFactory &library_snippet_factory) override
static constexpr const char * KERNEL_SNIPPET_FILE_EXT
Definition cuda_offload_dispatcher_strategy.h:49
void dispatch_kernel_call(codegen::PrettyPrinter &main_stream, const std::string &kernel_name, codegen::LanguageExtension &host_language_ext, symbolic::Expression &num_blocks_x, symbolic::Expression &num_blocks_y, symbolic::Expression &num_blocks_z, symbolic::Expression &block_size_x, symbolic::Expression &block_size_y, symbolic::Expression &block_size_z, std::vector< std::string > &arguments_device) override
void dispatch_kernel_launch_error_check(codegen::PrettyPrinter &stream, const codegen::LanguageExtension &language_extension)
std::string warp_shuffle_xor(const std::string &value, const std::string &lane_mask) const override
Cross-lane XOR butterfly shuffle of value by lane_mask (CUDA/HIP __shfl_xor_sync).
static constexpr const char * KERNEL_SNIPPET_HEADER_EXT
Definition cuda_offload_dispatcher_strategy.h:50
codegen::TargetType get_instrumentation_kernel_target_type() const override
bool is_device_pointer_storage(const types::StorageType &storage) const override
void emit_target_header_declarations(codegen::PrettyPrinter &kernel_header_stream) override
Target-specific includes/declarations emitted into the kernel include header (device fp16/bf16 intrin...
std::unique_ptr< codegen::LanguageExtension > create_kernel_language_extension(StructuredSDFG &sdfg, const StructuredLoop &loop) override
std::string kernel_file_extension() const override
File extension for the kernel translation unit ("cu"/"rocm.cpp").
bool is_matching_kernel_language_extension(const StructuredSDFG &sdfg, const StructuredLoop &loop, codegen::LanguageExtension &language_extension) override
Definition gpu_offload_base_dispatcher.h:19
Base class for structured loop constructs.
Definition structured_loop.h:244
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_library_node_rewriter_pass.h:11
Definition analysis.h:7
Symbolic system for integer-based symbol analysis.