Halide 14.0.0
Halide compiler and libraries
Halide::Runtime::Internal Namespace Reference

Namespaces

namespace  Constants
 
namespace  Cuda
 
namespace  Metal
 
namespace  Qurt
 
namespace  Synchronization
 

Classes

struct  CacheEntry
 
struct  CpuFeatures
 
struct  device_copy
 
struct  HashMap
 
struct  ScopedMutexLock
 
struct  ScopedSpinLock
 
class  StackPrinter
 
struct  THashMap
 
struct  work
 
struct  work_queue_t
 

Typedefs

typedef void(* copy_value_func) (uint8_t *dst, const uint8_t *src, size_t size)
 
typedef void(* destroy_value_func) (uint8_t *value, size_t size)
 
template<uint64_t buffer_length = default_printer_buffer_length>
using StackBasicPrinter = StackPrinter< BasicPrinterType, buffer_length >
 
template<uint64_t buffer_length = default_printer_buffer_length>
using StackErrorPrinter = StackPrinter< ErrorPrinterType, buffer_length >
 
template<uint64_t buffer_length = default_printer_buffer_length>
using StackStringStreamPrinter = StackPrinter< StringStreamPrinterType, buffer_length >
 

Enumerations

enum  PrinterType { BasicPrinterType = 0 , ErrorPrinterType = 1 , StringStreamPrinterType = 2 }
 

Functions

WEAK CpuFeatures halide_get_cpu_features ()
 
WEAK void copy_memory_helper (const device_copy &copy, int d, int64_t src_off, int64_t dst_off)
 
WEAK void copy_memory (const device_copy &copy, void *user_context)
 
WEAK device_copy make_buffer_copy (const halide_buffer_t *src, bool src_host, const halide_buffer_t *dst, bool dst_host)
 
WEAK device_copy make_host_to_device_copy (const halide_buffer_t *buf)
 
WEAK device_copy make_device_to_host_copy (const halide_buffer_t *buf)
 
ALWAYS_INLINE int64_t calc_device_crop_byte_offset (const struct halide_buffer_t *src, struct halide_buffer_t *dst)
 
ALWAYS_INLINE int64_t calc_device_slice_byte_offset (const struct halide_buffer_t *src, int slice_dim, int slice_pos)
 
template<typename Container >
bool any_zero (const Container &c)
 
bool keys_equal (const uint8_t *key1, const uint8_t *key2, size_t key_size)
 
uint32_t djb_hash (const uint8_t *key, size_t key_size)
 
WEAK objc_id create_autorelease_pool ()
 
WEAK void drain_autorelease_pool (objc_id pool)
 
WEAK void retain_ns_object (objc_id obj)
 
WEAK void release_ns_object (objc_id obj)
 
WEAK objc_id wrap_string_as_ns_string (const char *string, size_t length)
 
size_t strlen (const char *string)
 
WEAK void ns_log_utf8_string (const char *string)
 
WEAK void ns_log_object (objc_id obj)
 
ALWAYS_INLINE int clamp_num_threads (int threads)
 
WEAK int default_desired_num_threads ()
 
WEAK void worker_thread (void *)
 
WEAK void worker_thread_already_locked (work *owned_job)
 
WEAK void enqueue_work_already_locked (int num_jobs, work *jobs, work *task_parent)
 

Variables

constexpr uint64_t default_printer_buffer_length = 1024
 
WEAK work_queue_t work_queue = {}
 
WEAK halide_do_task_t custom_do_task = halide_default_do_task
 
WEAK halide_do_loop_task_t custom_do_loop_task = halide_default_do_loop_task
 
WEAK halide_do_par_for_t custom_do_par_for = halide_default_do_par_for
 
WEAK halide_do_parallel_tasks_t custom_do_parallel_tasks = halide_default_do_parallel_tasks
 
WEAK halide_semaphore_init_t custom_semaphore_init = halide_default_semaphore_init
 
WEAK halide_semaphore_try_acquire_t custom_semaphore_try_acquire = halide_default_semaphore_try_acquire
 
WEAK halide_semaphore_release_t custom_semaphore_release = halide_default_semaphore_release
 

Typedef Documentation

◆ copy_value_func

typedef void(* Halide::Runtime::Internal::copy_value_func) (uint8_t *dst, const uint8_t *src, size_t size)

Definition at line 38 of file hashmap.h.

◆ destroy_value_func

typedef void(* Halide::Runtime::Internal::destroy_value_func) (uint8_t *value, size_t size)

Definition at line 39 of file hashmap.h.

◆ StackBasicPrinter

template<uint64_t buffer_length = default_printer_buffer_length>
using Halide::Runtime::Internal::StackBasicPrinter = typedef StackPrinter<BasicPrinterType, buffer_length>

Definition at line 232 of file printer.h.

◆ StackErrorPrinter

template<uint64_t buffer_length = default_printer_buffer_length>
using Halide::Runtime::Internal::StackErrorPrinter = typedef StackPrinter<ErrorPrinterType, buffer_length>

Definition at line 235 of file printer.h.

◆ StackStringStreamPrinter

template<uint64_t buffer_length = default_printer_buffer_length>
using Halide::Runtime::Internal::StackStringStreamPrinter = typedef StackPrinter<StringStreamPrinterType, buffer_length>

Definition at line 238 of file printer.h.

Enumeration Type Documentation

◆ PrinterType

Enumerator
BasicPrinterType 
ErrorPrinterType 
StringStreamPrinterType 

Definition at line 7 of file printer.h.

Function Documentation

◆ halide_get_cpu_features()

WEAK CpuFeatures Halide::Runtime::Internal::halide_get_cpu_features ( )

◆ copy_memory_helper()

◆ copy_memory()

WEAK void Halide::Runtime::Internal::copy_memory ( const device_copy copy,
void *  user_context 
)

Definition at line 66 of file device_buffer_utils.h.

◆ make_buffer_copy()

WEAK device_copy Halide::Runtime::Internal::make_buffer_copy ( const halide_buffer_t src,
bool  src_host,
const halide_buffer_t dst,
bool  dst_host 
)

Definition at line 76 of file device_buffer_utils.h.

◆ make_host_to_device_copy()

WEAK device_copy Halide::Runtime::Internal::make_host_to_device_copy ( const halide_buffer_t buf)

Definition at line 163 of file device_buffer_utils.h.

◆ make_device_to_host_copy()

WEAK device_copy Halide::Runtime::Internal::make_device_to_host_copy ( const halide_buffer_t buf)

Definition at line 167 of file device_buffer_utils.h.

◆ calc_device_crop_byte_offset()

ALWAYS_INLINE int64_t Halide::Runtime::Internal::calc_device_crop_byte_offset ( const struct halide_buffer_t src,
struct halide_buffer_t dst 
)

Definition at line 172 of file device_buffer_utils.h.

◆ calc_device_slice_byte_offset()

ALWAYS_INLINE int64_t Halide::Runtime::Internal::calc_device_slice_byte_offset ( const struct halide_buffer_t src,
int  slice_dim,
int  slice_pos 
)

◆ any_zero()

template<typename Container >
bool Halide::Runtime::Internal::any_zero ( const Container &  c)

Definition at line 74 of file HalideBuffer.h.

◆ keys_equal()

bool Halide::Runtime::Internal::keys_equal ( const uint8_t key1,
const uint8_t key2,
size_t  key_size 
)
inline

Definition at line 26 of file hashmap.h.

References memcmp().

◆ djb_hash()

uint32_t Halide::Runtime::Internal::djb_hash ( const uint8_t key,
size_t  key_size 
)
inline

Definition at line 30 of file hashmap.h.

◆ create_autorelease_pool()

WEAK objc_id Halide::Runtime::Internal::create_autorelease_pool ( )

Definition at line 42 of file objc_support.h.

References objc_getClass(), objc_msgSend(), and sel_getUid().

◆ drain_autorelease_pool()

WEAK void Halide::Runtime::Internal::drain_autorelease_pool ( objc_id  pool)

Definition at line 50 of file objc_support.h.

References objc_msgSend(), and sel_getUid().

◆ retain_ns_object()

WEAK void Halide::Runtime::Internal::retain_ns_object ( objc_id  obj)

Definition at line 56 of file objc_support.h.

References objc_msgSend(), and sel_getUid().

◆ release_ns_object()

WEAK void Halide::Runtime::Internal::release_ns_object ( objc_id  obj)

Definition at line 62 of file objc_support.h.

References objc_msgSend(), and sel_getUid().

Referenced by ns_log_object(), and ns_log_utf8_string().

◆ wrap_string_as_ns_string()

WEAK objc_id Halide::Runtime::Internal::wrap_string_as_ns_string ( const char *  string,
size_t  length 
)

Definition at line 68 of file objc_support.h.

References objc_getClass(), objc_msgSend(), and sel_getUid().

Referenced by ns_log_object(), and ns_log_utf8_string().

◆ strlen()

size_t Halide::Runtime::Internal::strlen ( const char *  string)

Referenced by ns_log_utf8_string().

◆ ns_log_utf8_string()

WEAK void Halide::Runtime::Internal::ns_log_utf8_string ( const char *  string)

Definition at line 80 of file objc_support.h.

References NSLog(), release_ns_object(), strlen(), and wrap_string_as_ns_string().

◆ ns_log_object()

WEAK void Halide::Runtime::Internal::ns_log_object ( objc_id  obj)

Definition at line 88 of file objc_support.h.

References NSLog(), release_ns_object(), and wrap_string_as_ns_string().

◆ clamp_num_threads()

ALWAYS_INLINE int Halide::Runtime::Internal::clamp_num_threads ( int  threads)

Definition at line 74 of file thread_pool_common.h.

Referenced by enqueue_work_already_locked(), and halide_set_num_threads().

◆ default_desired_num_threads()

WEAK int Halide::Runtime::Internal::default_desired_num_threads ( )

◆ worker_thread()

WEAK void Halide::Runtime::Internal::worker_thread ( void *  arg)

◆ worker_thread_already_locked()

WEAK void Halide::Runtime::Internal::worker_thread_already_locked ( work owned_job)

Definition at line 205 of file thread_pool_common.h.

References Halide::Runtime::Internal::work_queue_t::a_team_size, Halide::Runtime::Internal::work::active_workers, halide_parallel_task_t::closure, dump_job_state, Halide::Runtime::Internal::work::exit_status, halide_parallel_task_t::extent, halide_parallel_task_t::fn, halide_cond_broadcast(), halide_cond_wait(), halide_do_loop_task(), halide_do_task(), halide_mutex_lock(), halide_mutex_unlock(), halide_thread_yield(), Halide::Runtime::Internal::work_queue_t::jobs, log_message, Halide::Runtime::Internal::work::make_runnable(), halide_parallel_task_t::min, halide_parallel_task_t::min_threads, Halide::Runtime::Internal::work_queue_t::mutex, halide_parallel_task_t::name, Halide::Runtime::Internal::work::next_job, Halide::Runtime::Internal::work::owner_is_sleeping, Halide::Runtime::Internal::work_queue_t::owners_sleeping, Halide::Runtime::Internal::work::parent_job, print_job, Halide::Runtime::Internal::work::running(), halide_parallel_task_t::serial, Halide::Runtime::Internal::work_queue_t::shutdown, Halide::Runtime::Internal::work::sibling_count, Halide::Runtime::Internal::work::siblings, Halide::Runtime::Internal::work_queue_t::target_a_team_size, Halide::Runtime::Internal::work::task, Halide::Runtime::Internal::work::task_fn, Halide::Runtime::Internal::work_queue_t::threads_created, Halide::Runtime::Internal::work::threads_reserved, Halide::Runtime::Internal::work_queue_t::threads_reserved, Halide::Runtime::Internal::work::user_context, Halide::Runtime::Internal::work_queue_t::wake_a_team, Halide::Runtime::Internal::work_queue_t::wake_b_team, Halide::Runtime::Internal::work_queue_t::wake_owners, work_queue, and Halide::Runtime::Internal::work_queue_t::workers_sleeping.

Referenced by worker_thread().

◆ enqueue_work_already_locked()

WEAK void Halide::Runtime::Internal::enqueue_work_already_locked ( int  num_jobs,
work jobs,
work task_parent 
)

Variable Documentation

◆ default_printer_buffer_length

constexpr uint64_t Halide::Runtime::Internal::default_printer_buffer_length = 1024
constexpr

Definition at line 11 of file printer.h.

◆ work_queue

◆ custom_do_task

WEAK halide_do_task_t Halide::Runtime::Internal::custom_do_task = halide_default_do_task

◆ custom_do_loop_task

WEAK halide_do_loop_task_t Halide::Runtime::Internal::custom_do_loop_task = halide_default_do_loop_task

◆ custom_do_par_for

WEAK halide_do_par_for_t Halide::Runtime::Internal::custom_do_par_for = halide_default_do_par_for

◆ custom_do_parallel_tasks

WEAK halide_do_parallel_tasks_t Halide::Runtime::Internal::custom_do_parallel_tasks = halide_default_do_parallel_tasks

Definition at line 577 of file thread_pool_common.h.

Referenced by halide_set_custom_parallel_runtime().

◆ custom_semaphore_init

WEAK halide_semaphore_init_t Halide::Runtime::Internal::custom_semaphore_init = halide_default_semaphore_init

◆ custom_semaphore_try_acquire

WEAK halide_semaphore_try_acquire_t Halide::Runtime::Internal::custom_semaphore_try_acquire = halide_default_semaphore_try_acquire

◆ custom_semaphore_release

WEAK halide_semaphore_release_t Halide::Runtime::Internal::custom_semaphore_release = halide_default_semaphore_release