Noodle
Loading...
Searching...
No Matches
noodle_memory.cpp File Reference

Noodle memory access management helpers. More...

#include "noodle_internal.h"
#include <limits.h>
Include dependency graph for noodle_memory.cpp:

Macros

#define NOODLE_TEMP_EXTERNAL_CAPACITY_UNKNOWN   ((size_t)-1)

Functions

static float * noodle_alloc_temp_float (size_t required_floats)
static float * noodle_temp_require_impl (void **ptr, size_t *capacity, size_t required_floats)
float * noodle_temp1_require (size_t required_floats)
 Ensure temp buffer 1 can hold a number of floats.
float * noodle_temp2_require (size_t required_floats)
 Ensure temp buffer 2 can hold a number of floats.
void noodle_temp_buffers_free (void)
 Release automatically allocated internal scratch buffers.
float * noodle_create_buffer (uint16_t size)
 Allocate a raw byte buffer and return it as a float pointer.
void noodle_delete_buffer (float *buffer)
 Free a buffer allocated by noodle_create_buffer().
float * noodle_slice (float *flat, size_t W, size_t z)
 Return a channel plane from a packed [Z][W][W] tensor.
void noodle_setup_temp_buffers (void *b1, void *b2)
 Install caller-owned internal scratch buffers.
void noodle_setup_temp_buffers (void *b2)
 Install only the caller-owned accumulation scratch buffer.

Variables

size_t temp_buff1_capacity
size_t temp_buff2_capacity

Detailed Description

Noodle memory access management helpers.

Macro Definition Documentation

◆ NOODLE_TEMP_EXTERNAL_CAPACITY_UNKNOWN

#define NOODLE_TEMP_EXTERNAL_CAPACITY_UNKNOWN   ((size_t)-1)

Function Documentation

◆ noodle_alloc_temp_float()

float * noodle_alloc_temp_float ( size_t required_floats)
static

◆ noodle_temp_require_impl()

float * noodle_temp_require_impl ( void ** ptr,
size_t * capacity,
size_t required_floats )
static

Variable Documentation

◆ temp_buff1_capacity

size_t temp_buff1_capacity
extern

◆ temp_buff2_capacity

size_t temp_buff2_capacity
extern