Loading...
Searching...
No Matches
synchronization_common.h File Reference
`#include "HalideRuntime.h"`
`#include "printer.h"`
`#include "scoped_spin_lock.h"`
`#include "runtime_atomics.h"`

Go to the source code of this file.

## Classes

class | Halide::Runtime::Internal::Synchronization::spin_control
struct | Halide::Runtime::Internal::Synchronization::word_lock_queue_data
class | Halide::Runtime::Internal::Synchronization::word_lock
struct | Halide::Runtime::Internal::Synchronization::queue_data
struct | Halide::Runtime::Internal::Synchronization::hash_bucket
struct | Halide::Runtime::Internal::Synchronization::hash_table
struct | Halide::Runtime::Internal::Synchronization::bucket_pair
struct | Halide::Runtime::Internal::Synchronization::validate_action
struct | Halide::Runtime::Internal::Synchronization::parking_control
struct | Halide::Runtime::Internal::Synchronization::mutex_parking_control
class | Halide::Runtime::Internal::Synchronization::fast_mutex
struct | Halide::Runtime::Internal::Synchronization::signal_parking_control
struct | Halide::Runtime::Internal::Synchronization::broadcast_parking_control
struct | Halide::Runtime::Internal::Synchronization::wait_parking_control
class | Halide::Runtime::Internal::Synchronization::fast_cond
struct | halide_mutex_array

## Namespaces

namespace | Halide
| This file defines the class FunctionDAG, which is our representation of a Halide pipeline, and contains methods to using Halide's bounds tools to query properties of it.
namespace | Halide::Runtime
namespace | Halide::Runtime::Internal
namespace | Halide::Runtime::Internal::Synchronization

## Macros

#define | TSAN_ANNOTATIONS 0

## Functions

WEAK hash_bucket & | Halide::Runtime::Internal::Synchronization::lock_bucket (uintptr_t addr)
WEAK bucket_pair | Halide::Runtime::Internal::Synchronization::lock_bucket_pair (uintptr_t addr_from, uintptr_t addr_to)
WEAK void | Halide::Runtime::Internal::Synchronization::unlock_bucket_pair (bucket_pair &buckets)
WEAK void | halide_mutex_lock (halide_mutex *mutex)
| A basic set of mutex and condition variable functions, which call platform specific code for mutual exclusion.
WEAK void | halide_mutex_unlock (halide_mutex *mutex)
WEAK void | halide_cond_broadcast (struct halide_cond *cond)
WEAK void | halide_cond_signal (struct halide_cond *cond)
WEAK void | halide_cond_wait (struct halide_cond *cond, struct halide_mutex *mutex)
WEAK halide_mutex_array * | halide_mutex_array_create (uint64_t sz)
WEAK void | halide_mutex_array_destroy (void *user_context, void *array)
WEAK int | halide_mutex_array_lock (struct halide_mutex_array *array, int entry)
WEAK int | halide_mutex_array_unlock (struct halide_mutex_array *array, int entry)

## Variables

constexpr int | Halide::Runtime::Internal::Synchronization::LOAD_FACTOR = 4
constexpr int | Halide::Runtime::Internal::Synchronization::HASH_TABLE_SIZE = MAX_THREADS * LOAD_FACTOR
WEAK hash_table | Halide::Runtime::Internal::Synchronization::table
constexpr int | Halide::Runtime::Internal::Synchronization::HASH_TABLE_BITS = 10

## Macro Definition Documentation

## TSAN_ANNOTATIONS

#define TSAN_ANNOTATIONS 0

Definition at line 34 of file synchronization_common.h.

## Function Documentation

## halide_mutex_lock()

WEAK void halide_mutex_lock | ( | struct halide_mutex * | mutex | ) |

A basic set of mutex and condition variable functions, which call platform specific code for mutual exclusion.

Equivalent to posix calls.

Definition at line 876 of file synchronization_common.h.

References Halide::Runtime::Internal::Synchronization::fast_mutex::lock(), and WEAK.

Referenced by halide_default_do_par_for(), halide_default_do_parallel_tasks(), halide_default_semaphore_release(), halide_get_num_threads(), halide_mutex_array_lock(), halide_set_num_threads(), halide_shutdown_thread_pool(), Halide::Runtime::Internal::ScopedMutexLock::ScopedMutexLock(), Halide::Runtime::Internal::halide_cond_with_spinning::wait(), Halide::Runtime::Internal::worker_thread(), and Halide::Runtime::Internal::worker_thread_already_locked().

## halide_mutex_unlock()

WEAK void halide_mutex_unlock | ( | halide_mutex * | mutex | ) |

Definition at line 882 of file synchronization_common.h.

References Halide::Runtime::Internal::Synchronization::fast_mutex::unlock(), and WEAK.

Referenced by halide_default_do_par_for(), halide_default_do_parallel_tasks(), halide_default_semaphore_release(), halide_get_num_threads(), halide_mutex_array_unlock(), halide_set_num_threads(), halide_shutdown_thread_pool(), Halide::Runtime::Internal::halide_cond_with_spinning::wait(), Halide::Runtime::Internal::worker_thread(), Halide::Runtime::Internal::worker_thread_already_locked(), and Halide::Runtime::Internal::ScopedMutexLock::~ScopedMutexLock().

## halide_cond_broadcast()

WEAK void halide_cond_broadcast | ( | struct halide_cond * | cond | ) |

Definition at line 888 of file synchronization_common.h.

References Halide::Runtime::Internal::Synchronization::fast_cond::broadcast(), and WEAK.

Referenced by Halide::Runtime::Internal::halide_cond_with_spinning::broadcast().

## halide_cond_signal()

WEAK void halide_cond_signal | ( | struct halide_cond * | cond | ) |

Definition at line 894 of file synchronization_common.h.

References Halide::Runtime::Internal::Synchronization::fast_cond::signal(), and WEAK.

## halide_cond_wait()

WEAK void halide_cond_wait | ( | struct halide_cond * | cond,
|  | struct halide_mutex * | mutex )

Definition at line 900 of file synchronization_common.h.

References Halide::Runtime::Internal::Synchronization::fast_cond::wait(), and WEAK.

Referenced by Halide::Runtime::Internal::halide_cond_with_spinning::wait().

## halide_mutex_array_create()

WEAK halide_mutex_array * halide_mutex_array_create | ( | uint64_t | sz | ) |

Definition at line 913 of file synchronization_common.h.

References halide_mutex_array::array, halide_free(), halide_malloc(), memset(), and WEAK.

## halide_mutex_array_destroy()

WEAK void halide_mutex_array_destroy | ( | void * | user_context,
|  | void * | array )

Definition at line 933 of file synchronization_common.h.

References halide_mutex_array::array, halide_free(), and WEAK.

## halide_mutex_array_lock()

WEAK int halide_mutex_array_lock | ( | struct halide_mutex_array * | array,
|  | int | entry )

Definition at line 939 of file synchronization_common.h.

References halide_mutex_array::array, halide_error_code_success, halide_mutex_lock(), and WEAK.

## halide_mutex_array_unlock()

WEAK int halide_mutex_array_unlock | ( | struct halide_mutex_array * | array,
|  | int | entry )

Definition at line 944 of file synchronization_common.h.

References halide_mutex_array::array, halide_error_code_success, halide_mutex_unlock(), and WEAK.