1#ifndef HALIDE_RUNTIME_STRING_TABLE_H
2#define HALIDE_RUNTIME_STRING_TABLE_H
49 const char **
data()
const;
52 bool contains(
const char *str)
const;
55 return contents.
size();
66 : contents(nullptr, 0, sma),
67 pointers(nullptr, 0, sma) {
92 for (
size_t n = 0; n < contents.
size(); ++n) {
99 for (
size_t n = 0; n < contents.
size(); ++n) {
109 for (
size_t n = 0; n < contents.
size(); ++n) {
119 if (index < pointers.
size()) {
120 return static_cast<const char *
>(pointers[index]);
127 for (
size_t n = 0; n < count && n < contents.
size(); ++n) {
138 if (index < contents.
size()) {
164 size_t delim_length =
strlen(delim);
165 size_t total_length =
strlen(str);
167 if (entry_count < 1) {
175 const char *ptr = str;
177 size_t ptr_offset = ptr - str;
178 const char *next_delim =
strstr(ptr, delim);
179 size_t token_length = (next_delim ==
nullptr) ? (total_length - ptr_offset) : (next_delim - ptr);
180 if (token_length > 0 && index < contents.
size()) {
186 ptr = (next_delim !=
nullptr) ? (next_delim + delim_length) :
nullptr;
195 for (
size_t n = 0; n < contents.
size(); ++n) {
206 return reinterpret_cast<const char **
>(pointers.
data());
This file declares the routines used by Halide internally in its runtime.
const SystemMemoryAllocatorFns & current_allocator() const
void clear(void *user_context)
void prepend(void *user_context, const void *entry_ptr)
void destroy(void *user_context)
void resize(void *user_context, size_t entry_count, bool realloc=true)
void append(void *user_context, const void *entry_ptr)
void assign(void *user_context, size_t index, const void *entry_ptr)
void assign(void *user_context, char ch)
static const SystemMemoryAllocatorFns & default_allocator()
const char * data() const
static StringStorage * create(void *user_context, const SystemMemoryAllocatorFns &ma)
bool contains(const char *str) const
static void destroy(void *user_context, StringStorage *string_storage)
void append(void *user_context, const char *str, size_t length=0)
StringTable(const StringTable &)=delete
const char ** data() const
size_t parse(void *user_context, const char *str, const char *delim)
void assign(void *user_context, size_t index, const char *str, size_t length=0)
void destroy(void *user_context)
const char * operator[](size_t index) const
void resize(void *user_context, size_t capacity)
void clear(void *user_context)
StringTable & operator=(const StringTable &)=delete
void prepend(void *user_context, const char *str, size_t length=0)
void fill(void *user_context, const char **array, size_t count)
bool contains(const char *str) const
size_t strlen(const char *string)
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
const char * strstr(const char *, const char *)
static size_t count_tokens(const char *str, const char *delim)
static bool is_empty(const char *str)
VulkanMemoryAllocator * allocator