Halide
GPULoopInfo.h
Go to the documentation of this file.
1 #ifndef GPU_LOOP_INFO_H
2 #define GPU_LOOP_INFO_H
3 
4 /** \file
5  *
6  * Data structure containing information about the current GPU loop nest
7  * hierarchy of blocks, threads, etc. Useful when computing GPU features
8  */
9 
10 #include <vector>
11 
12 #include "Halide.h"
13 #include "ThreadInfo.h"
14 
15 namespace Halide {
16 namespace Internal {
17 namespace Autoscheduler {
18 
19 struct LoopNest;
20 
21 struct GPULoopInfo {
23  : root{root} {
24  }
25 
26  const LoopNest *root = nullptr;
27  const LoopNest *current_block_loop = nullptr;
28  const LoopNest *current_thread_loop = nullptr;
29  std::vector<const LoopNest *> inner_loop_stack;
33  const ThreadInfo *thread_info = nullptr;
34 
35  void update(const Target &target, const LoopNest *loop);
36 
38 
39  bool at_or_inside_block() const;
40 
41  bool at_or_inside_thread() const;
42 
43  std::vector<int64_t> get_inner_serial_loop_extents(const LoopNest *loop_nest) const;
44 
45  std::unique_ptr<ThreadInfo> create_thread_info();
46 
48 };
49 
50 } // namespace Autoscheduler
51 } // namespace Internal
52 } // namespace Halide
53 
54 #endif // GPU_LOOP_INFO_H
Halide::Internal::Autoscheduler::GPULoopInfo::thread_info
const ThreadInfo * thread_info
Definition: GPULoopInfo.h:33
Halide::Internal::Autoscheduler::GPULoopInfo::get_total_inner_serial_extents_outside_realization
int64_t get_total_inner_serial_extents_outside_realization(const LoopNest *loop_nest) const
Halide::Internal::Autoscheduler::GPULoopInfo::num_blocks
int64_t num_blocks
Definition: GPULoopInfo.h:30
Halide::Internal::Autoscheduler::GPULoopInfo::total_outer_serial_extents
int64_t total_outer_serial_extents
Definition: GPULoopInfo.h:31
Halide::Internal::Autoscheduler::GPULoopInfo::at_or_inside_thread
bool at_or_inside_thread() const
Halide::Internal::Autoscheduler::GPULoopInfo::total_serial_extents
int64_t total_serial_extents() const
ThreadInfo.h
Halide
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
Definition: AbstractGenerator.h:19
Halide::Internal::Autoscheduler::GPULoopInfo::get_inner_serial_loop_extents
std::vector< int64_t > get_inner_serial_loop_extents(const LoopNest *loop_nest) const
Halide::LinkageType::Internal
@ Internal
Not visible externally, similar to 'static' linkage in C.
Halide::Internal::Autoscheduler::GPULoopInfo::update
void update(const Target &target, const LoopNest *loop)
Halide::Internal::Autoscheduler::LoopNest
Definition: LoopNest.h:34
Halide::Internal::Autoscheduler::GPULoopInfo::GPULoopInfo
GPULoopInfo(const LoopNest *root)
Definition: GPULoopInfo.h:22
Halide::Internal::Autoscheduler::ThreadInfo
Definition: ThreadInfo.h:40
Halide::Internal::Autoscheduler::GPULoopInfo::total_inner_serial_extents
int64_t total_inner_serial_extents
Definition: GPULoopInfo.h:32
int64_t
signed __INT64_TYPE__ int64_t
Definition: runtime_internal.h:22
Halide::Internal::Autoscheduler::GPULoopInfo::root
const LoopNest * root
Definition: GPULoopInfo.h:26
Halide::Internal::Autoscheduler::GPULoopInfo::create_thread_info
std::unique_ptr< ThreadInfo > create_thread_info()
Halide::Internal::Autoscheduler::GPULoopInfo::current_thread_loop
const LoopNest * current_thread_loop
Definition: GPULoopInfo.h:28
Halide::Internal::Autoscheduler::GPULoopInfo::at_or_inside_block
bool at_or_inside_block() const
Halide::Internal::Autoscheduler::GPULoopInfo
Definition: GPULoopInfo.h:21
Halide::Internal::Autoscheduler::GPULoopInfo::inner_loop_stack
std::vector< const LoopNest * > inner_loop_stack
Definition: GPULoopInfo.h:29
Halide::Internal::Autoscheduler::GPULoopInfo::current_block_loop
const LoopNest * current_block_loop
Definition: GPULoopInfo.h:27
Halide::Target
A struct representing a target machine and os to generate code for.
Definition: Target.h:19