Halide 22.0.0 Halide compiler and libraries

Public Member Functions | Public Attributes | List of all members
Halide::Internal::Autoscheduler::ThreadInfo Struct Reference

`#include <ThreadInfo.h>`

## Public Member Functions
| ThreadInfo (int vectorized_loop_index, const std::vector< int64_t > &size, const std::vector< FunctionDAG::Node::Loop > &loop, const std::vector< int64_t > &max_thread_counts)
template<typename Fn >
void | for_each_thread_id (const Fn &fn) const
template<typename Fn >
void | for_each_thread_id_in_first_warp (Fn &fn) const
template<typename Fn >
void | for_each_thread_id_in_tail_warp (Fn &fn) const
template<typename Fn >
void | for_each_active_thread_id (const Fn &fn) const
double | warp_lane_utilization () const
double | idle_lane_wastage () const
double | block_occupancy () const

## Public Attributes
int | num_warps_per_block = 0
int | num_active_warps_per_block = 0
int | num_regular_active_warps_per_block = 0
bool | has_tail_warp = false
int | final_warp_initial_thread_id = 0
int | num_threads_in_final_warp = 0
int | threads_in_this_block [3] = {1, 1, 1}
int64_t | num_threads_in_this_block = 1
int | threads [3] = {1, 1, 1}
int64_t | num_threads = 1
int64_t | num_active_threads = 0
std::vector< int > | loop_indices
std::vector< std::string > | loop_vars

## Detailed Description

Definition at line 40 of file ThreadInfo.h.

## Constructor & Destructor Documentation

## ◆ ThreadInfo()

Halide::Internal::Autoscheduler::ThreadInfo::ThreadInfo | ( | int | vectorized_loop_index,
|  | const std::vector< int64_t > & | size,
|  | const std::vector< FunctionDAG::Node::Loop > & | loop,
|  | const std::vector< int64_t > & | max_thread_counts
| ) |  |
| inline

Definition at line 41 of file ThreadInfo.h.

References internal_assert, loop_indices, loop_vars, num_threads, num_threads_in_this_block, and threads.

## Member Function Documentation

## ◆ for_each_thread_id()

template<typename Fn >

void Halide::Internal::Autoscheduler::ThreadInfo::for_each_thread_id | ( | const Fn & | fn | ) | const
| inline

Definition at line 87 of file ThreadInfo.h.

References num_threads_in_this_block, threads, and threads_in_this_block.

Referenced by for_each_active_thread_id().

## ◆ for_each_thread_id_in_first_warp()

template<typename Fn >

void Halide::Internal::Autoscheduler::ThreadInfo::for_each_thread_id_in_first_warp | ( | Fn & | fn | ) | const
| inline

Definition at line 109 of file ThreadInfo.h.

References threads, and threads_in_this_block.

## ◆ for_each_thread_id_in_tail_warp()

template<typename Fn >

void Halide::Internal::Autoscheduler::ThreadInfo::for_each_thread_id_in_tail_warp | ( | Fn & | fn | ) | const
| inline

Definition at line 136 of file ThreadInfo.h.

References final_warp_initial_thread_id, internal_assert, num_threads_in_final_warp, threads, and threads_in_this_block.

## ◆ for_each_active_thread_id()

template<typename Fn >

void Halide::Internal::Autoscheduler::ThreadInfo::for_each_active_thread_id | ( | const Fn & | fn | ) | const
| inline

Definition at line 156 of file ThreadInfo.h.

References for_each_thread_id().

## ◆ warp_lane_utilization()

double Halide::Internal::Autoscheduler::ThreadInfo::warp_lane_utilization | ( |  | ) | const
| inline

Definition at line 166 of file ThreadInfo.h.

References num_active_threads, and num_active_warps_per_block.

## ◆ idle_lane_wastage()

double Halide::Internal::Autoscheduler::ThreadInfo::idle_lane_wastage | ( |  | ) | const
| inline

Definition at line 170 of file ThreadInfo.h.

References num_active_threads, and num_active_warps_per_block.

## ◆ block_occupancy()

double Halide::Internal::Autoscheduler::ThreadInfo::block_occupancy | ( |  | ) | const
| inline

Definition at line 174 of file ThreadInfo.h.

References num_threads.

## Member Data Documentation

## ◆ num_warps_per_block

int Halide::Internal::Autoscheduler::ThreadInfo::num_warps_per_block = 0

Definition at line 178 of file ThreadInfo.h.

## ◆ num_active_warps_per_block

int Halide::Internal::Autoscheduler::ThreadInfo::num_active_warps_per_block = 0

Definition at line 179 of file ThreadInfo.h.

Referenced by idle_lane_wastage(), and warp_lane_utilization().

## ◆ num_regular_active_warps_per_block

int Halide::Internal::Autoscheduler::ThreadInfo::num_regular_active_warps_per_block = 0

Definition at line 180 of file ThreadInfo.h.

## ◆ has_tail_warp

bool Halide::Internal::Autoscheduler::ThreadInfo::has_tail_warp = false

Definition at line 181 of file ThreadInfo.h.

## ◆ final_warp_initial_thread_id

int Halide::Internal::Autoscheduler::ThreadInfo::final_warp_initial_thread_id = 0

Definition at line 182 of file ThreadInfo.h.

Referenced by for_each_thread_id_in_tail_warp().

## ◆ num_threads_in_final_warp

int Halide::Internal::Autoscheduler::ThreadInfo::num_threads_in_final_warp = 0

Definition at line 183 of file ThreadInfo.h.

Referenced by for_each_thread_id_in_tail_warp().

## ◆ threads_in_this_block

int Halide::Internal::Autoscheduler::ThreadInfo::threads_in_this_block[3] = {1, 1, 1}

Definition at line 185 of file ThreadInfo.h.

Referenced by for_each_thread_id(), for_each_thread_id_in_first_warp(), and for_each_thread_id_in_tail_warp().

## ◆ num_threads_in_this_block

int64_t Halide::Internal::Autoscheduler::ThreadInfo::num_threads_in_this_block = 1

Definition at line 186 of file ThreadInfo.h.

Referenced by for_each_thread_id(), and ThreadInfo().

## ◆ threads

int Halide::Internal::Autoscheduler::ThreadInfo::threads[3] = {1, 1, 1}

Definition at line 188 of file ThreadInfo.h.

Referenced by for_each_thread_id(), for_each_thread_id_in_first_warp(), for_each_thread_id_in_tail_warp(), and ThreadInfo().

## ◆ num_threads

int64_t Halide::Internal::Autoscheduler::ThreadInfo::num_threads = 1

Definition at line 189 of file ThreadInfo.h.

Referenced by block_occupancy(), and ThreadInfo().

## ◆ num_active_threads

int64_t Halide::Internal::Autoscheduler::ThreadInfo::num_active_threads = 0

Definition at line 190 of file ThreadInfo.h.

Referenced by idle_lane_wastage(), and warp_lane_utilization().

## ◆ loop_indices

std::vector<int> Halide::Internal::Autoscheduler::ThreadInfo::loop_indices

Definition at line 192 of file ThreadInfo.h.

Referenced by ThreadInfo().

## ◆ loop_vars

std::vector<std::string> Halide::Internal::Autoscheduler::ThreadInfo::loop_vars

Definition at line 193 of file ThreadInfo.h.

Referenced by ThreadInfo().

The documentation for this struct was generated from the following file:

- src/autoschedulers/anderson2021/ThreadInfo.h