Numerically explicit audio frontend reference kernels. More...
#include "ckernel_audio.h"#include "ck_threadpool.h"#include <math.h>#include <limits.h>#include <stddef.h>#include <stdlib.h>#include <string.h>Go to the source code of this file.
Macros | |
| #define | CK_AUDIO_PI_D 3.14159265358979323846264338327950288 |
| #define | CK_AUDIO_PI_F 3.14159265358979323846f |
Functions | |
| int | audio_argmax_first_f32 (const float *values, int elements, int *selected) |
| int | audio_batch_norm_inference_channel_major_f32 (const float *input, const float *running_mean, const float *running_variance, const float *weight, const float *bias, float *output, int channels, int frames, float epsilon) |
| int | audio_conformer_relative_attention_f32 (const float *query, const float *key, const float *value, const float *relative_key, const float *bias_u, const float *bias_v, float *output, int frames, int heads, int head_dim, float scale, float *scores_scratch, size_t scores_scratch_bytes) |
| int | audio_conv1d_channel_major_f32 (const float *input, const float *weight, const float *bias, float *output, int input_channels, int output_channels, int input_frames, int kernel_size, int stride, int padding, int output_frames) |
| int | audio_conv1d_channel_major_grouped_f32 (const float *input, const float *weight, const float *bias, float *output, int input_channels, int output_channels, int input_frames, int kernel_size, int stride, int padding, int groups, int output_frames) |
| int | audio_conv2d_whc_grouped_f32 (const float *input, const float *weight, const float *bias, float *output, int input_width, int input_height, int input_channels, int output_channels, int kernel_width, int kernel_height, int stride_width, int stride_height, int padding_width, int padding_height, int groups, int output_width, int output_height) |
| int | audio_fastconformer_block_f32 (const float *input, const float *relative_positions, const float *ff1_norm_weight, const float *ff1_norm_bias, const float *ff1_up_weight, const float *ff1_up_bias, const float *ff1_down_weight, const float *ff1_down_bias, const float *attn_norm_weight, const float *attn_norm_bias, const float *q_weight, const float *q_bias, const float *k_weight, const float *k_bias, const float *v_weight, const float *v_bias, const float *relative_weight, const float *attn_bias_u, const float *attn_bias_v, const float *attn_out_weight, const float *attn_out_bias, const float *conv_norm_weight, const float *conv_norm_bias, const float *conv_pw1_weight, const float *conv_pw1_bias, const float *conv_dw_weight, const float *conv_dw_bias, const float *conv_bn_mean, const float *conv_bn_variance, const float *conv_bn_weight, const float *conv_bn_bias, const float *conv_pw2_weight, const float *conv_pw2_bias, const float *ff2_norm_weight, const float *ff2_norm_bias, const float *ff2_up_weight, const float *ff2_up_bias, const float *ff2_down_weight, const float *ff2_down_bias, const float *out_norm_weight, const float *out_norm_bias, float *output, void *workspace, size_t workspace_bytes, int frames, int hidden_size, int intermediate_size, int heads, int head_dim, int conv_kernel_size, float layer_norm_epsilon, float batch_norm_epsilon) |
| size_t | audio_fastconformer_block_workspace_bytes (int frames, int hidden_size, int intermediate_size, int heads) |
| static size_t | audio_fastconformer_block_workspace_bytes_for_score_slots (int frames, int hidden_size, int intermediate_size, int heads, size_t score_slots) |
| int | audio_fastconformer_subsampling_f32 (const float *features, const float *conv0_weight, const float *conv0_bias, const float *depthwise1_weight, const float *depthwise1_bias, const float *pointwise1_weight, const float *pointwise1_bias, const float *depthwise2_weight, const float *depthwise2_bias, const float *pointwise2_weight, const float *pointwise2_bias, const float *linear_weight, const float *linear_bias, float *output, void *workspace, size_t workspace_bytes, int feature_frames, int live_frames, int feature_channels, int conv_channels, int hidden_size, int kernel_size, int stride, int output_capacity_frames, int *output_frames) |
| size_t | audio_fastconformer_subsampling_workspace_bytes (int feature_frames, int feature_channels, int conv_channels, int kernel_size, int stride) |
| int | audio_feature_normalize_per_feature_f32 (const float *input, float *output, int channels, int frames, float epsilon) |
| int | audio_glu_split_channel_major_f32 (const float *input, float *output, int channels, int frames) |
| int | audio_hann_window_f32 (float *output, int frames, int periodic) |
| static double | audio_hz_to_mel_slaney (double hz) |
| int | audio_log_mel_time_major_f32 (const float *power, const float *mel_filters, float *log_mel, int frames, int bins, int channels, float epsilon) |
| int | audio_lstm_step_f32 (const float *input, const float *weight_ih, const float *weight_hh, const float *bias_ih, const float *bias_hh, float *hidden_state, float *cell_state, float *output, float *gates_scratch, size_t gates_scratch_bytes, int input_size, int hidden_size) |
| static double | audio_mel_to_hz_slaney (double mel) |
| int | audio_pad_or_truncate_f32 (const float *input, int input_frames, float *output, int output_frames) |
| int | audio_pcm_s16_to_mono_f32 (const int16_t *interleaved, int n_frames, int n_channels, float *mono) |
| int | audio_preemphasis_f32 (const float *input, float *output, int frames, float coefficient) |
| int | audio_relative_shift_f32 (const float *raw_scores, float *scores, int heads, int query_frames) |
| int | audio_relative_sinusoidal_position_f32 (float *output, int frames, int channels) |
| int | audio_resample_linear_f32 (const float *input, int input_frames, int input_rate, float *output, int output_frames, int output_rate) |
| int | audio_resample_windowed_sinc_f32 (const float *input, int input_frames, int input_rate, float *output, int output_frames, int output_rate, int radius) |
| int | audio_resampled_frame_count (int input_frames, int input_rate, int output_rate) |
| int | audio_scaled_residual_add_f32 (const float *residual, const float *branch, float scale, float *output, size_t elements) |
| int | audio_stft_power_centered_window_f32 (const float *samples, int n_samples, const float *window, int window_length, const float *cos_table, const float *sin_table, int n_fft, int hop_length, int reflect_padding, float *power, int n_frames) |
| int | audio_stft_power_fft400_f32 (const float *samples, int n_samples, const float *window, const float *cos_table, const float *sin_table, int hop_length, float *power, int n_frames, float *fft_scratch) |
| static void | audio_stft_power_fft400_frame_f32 (const float *samples, int n_samples, int frame, const float *window, const float *cos_table, const float *sin_table, float *power, float *fft_scratch) |
| int | audio_stft_power_precomputed_f32 (const float *samples, int n_samples, const float *window, const float *cos_table, const float *sin_table, int n_fft, int hop_length, float *power, int n_frames) |
| int | audio_stft_precompute_tables_f32 (int n_fft, float *window, float *cos_table, float *sin_table) |
| int | audio_transpose_channel_to_token_f32 (const float *input, float *output, int channels, int frames) |
| int | audio_wav_decode_memory_pcm16_mono_f32 (const uint8_t *bytes, size_t byte_count, float *mono, int mono_capacity, CKAudioWavInfo *info) |
| int | audio_wav_decode_memory_pcm16_mono_window_f32 (const uint8_t *bytes, size_t byte_count, int start_frame, float *mono, int mono_capacity, CKAudioWavInfo *info) |
| int | audio_wav_decode_pcm16_mono_f32 (const uint8_t *bytes, size_t byte_count, const CKAudioWavInfo *info, float *mono, int mono_capacity) |
| int | audio_wav_parse_memory (const uint8_t *bytes, size_t byte_count, CKAudioWavInfo *info) |
| int | audio_whisper_log_mel_from_power_reference_f32 (const float *power, const float *mel_filters, int n_mels, int n_frames, float *log_mel) |
| int | audio_whisper_log_mel_reference_f32 (const float *samples, int n_samples, const float *mel_filters, int n_mels, float *power_scratch, float *log_mel, int n_frames) |
| int | audio_whisper_log_mel_window_wav_pcm16_f32 (const uint8_t *bytes, size_t byte_count, int start_frame, int target_sample_rate, const float *window, const float *cos_table, const float *sin_table, const float *mel_filters, int n_mels, int output_frames, float *log_mel) |
| int | audio_whisper_mel_filters_slaney_f32 (int sample_rate, int n_fft, int n_mels, float *mel_filters) |
| int | audio_whisper_stft_power_reference_f32 (const float *samples, int n_samples, float *power, int n_frames) |
| static int | checked_add_size (size_t left, size_t right, size_t *result) |
| static int | checked_mul_size (size_t left, size_t right, size_t *result) |
| static void | ck_audio_conformer_relative_attention_f32_row_range (int begin, int end, void *opaque) |
| static void | ck_audio_conv1d_channel_major_f32_work (int ith, int nth, void *opaque) |
| static void | ck_audio_conv2d_whc_grouped_f32_range (int begin, int end, void *opaque) |
| static void | ck_audio_glu_split_f32_range (int begin, int end, void *opaque) |
| static void | ck_audio_relative_shift_f32_range (int begin, int end, void *opaque) |
| static int | conv_output_extent (int input, int kernel, int stride, int padding) |
| void | gemm_nt_f32_llama_production_parallel_dispatch (const float *A, const float *B, const float *bias, float *C, int M, int N, int K) |
| void | layernorm_naive_serial_matched_precision (const float *input, const float *gamma, const float *beta, float *output, float *mean_cache, float *rstd_cache, int tokens, int d_model, float eps) |
| static uint16_t | read_u16_le (const uint8_t *p) |
| static uint32_t | read_u32_le (const uint8_t *p) |
| void | recurrent_silu_forward (const float *input, float *output, int rows, int dim) |
| static int | reflect_index (int index, int length) |
| static void | relu_subsampling_inplace (float *value, size_t elements) |
| static void | zero_subsampling_padding (float *value, int channels, int frames, int width, int live_frames) |
Numerically explicit audio frontend reference kernels.
Definition in file audio_kernels.c.
| #define CK_AUDIO_PI_D 3.14159265358979323846264338327950288 |
Definition at line 19 of file audio_kernels.c.
| #define CK_AUDIO_PI_F 3.14159265358979323846f |
Definition at line 18 of file audio_kernels.c.
| int audio_argmax_first_f32 | ( | const float * | values, |
| int | elements, | ||
| int * | selected | ||
| ) |
Definition at line 2147 of file audio_kernels.c.
| int audio_batch_norm_inference_channel_major_f32 | ( | const float * | input, |
| const float * | running_mean, | ||
| const float * | running_variance, | ||
| const float * | weight, | ||
| const float * | bias, | ||
| float * | output, | ||
| int | channels, | ||
| int | frames, | ||
| float | epsilon | ||
| ) |
Definition at line 469 of file audio_kernels.c.
Referenced by audio_fastconformer_block_f32().
| int audio_conformer_relative_attention_f32 | ( | const float * | query, |
| const float * | key, | ||
| const float * | value, | ||
| const float * | relative_key, | ||
| const float * | bias_u, | ||
| const float * | bias_v, | ||
| float * | output, | ||
| int | frames, | ||
| int | heads, | ||
| int | head_dim, | ||
| float | scale, | ||
| float * | scores_scratch, | ||
| size_t | scores_scratch_bytes | ||
| ) |
Definition at line 1766 of file audio_kernels.c.
References ck_audio_conformer_relative_attention_f32_row_range(), ck_threadpool_global(), ck_threadpool_n_threads(), and ck_threadpool_parallel_for_n().
Referenced by audio_fastconformer_block_f32().
| int audio_conv1d_channel_major_f32 | ( | const float * | input, |
| const float * | weight, | ||
| const float * | bias, | ||
| float * | output, | ||
| int | input_channels, | ||
| int | output_channels, | ||
| int | input_frames, | ||
| int | kernel_size, | ||
| int | stride, | ||
| int | padding, | ||
| int | output_frames | ||
| ) |
Definition at line 1309 of file audio_kernels.c.
References audio_conv1d_channel_major_grouped_f32().
| int audio_conv1d_channel_major_grouped_f32 | ( | const float * | input, |
| const float * | weight, | ||
| const float * | bias, | ||
| float * | output, | ||
| int | input_channels, | ||
| int | output_channels, | ||
| int | input_frames, | ||
| int | kernel_size, | ||
| int | stride, | ||
| int | padding, | ||
| int | groups, | ||
| int | output_frames | ||
| ) |
Definition at line 1327 of file audio_kernels.c.
References ck_audio_conv1d_channel_major_f32_work(), ck_threadpool_dispatch_n(), ck_threadpool_global(), and ck_threadpool_n_threads().
Referenced by audio_conv1d_channel_major_f32(), and audio_fastconformer_block_f32().
| int audio_conv2d_whc_grouped_f32 | ( | const float * | input, |
| const float * | weight, | ||
| const float * | bias, | ||
| float * | output, | ||
| int | input_width, | ||
| int | input_height, | ||
| int | input_channels, | ||
| int | output_channels, | ||
| int | kernel_width, | ||
| int | kernel_height, | ||
| int | stride_width, | ||
| int | stride_height, | ||
| int | padding_width, | ||
| int | padding_height, | ||
| int | groups, | ||
| int | output_width, | ||
| int | output_height | ||
| ) |
Definition at line 1500 of file audio_kernels.c.
References ck_audio_conv2d_whc_grouped_f32_range(), ck_threadpool_global(), ck_threadpool_n_threads(), and ck_threadpool_parallel_for_n().
Referenced by audio_fastconformer_subsampling_f32().
| int audio_fastconformer_block_f32 | ( | const float * | input, |
| const float * | relative_positions, | ||
| const float * | ff1_norm_weight, | ||
| const float * | ff1_norm_bias, | ||
| const float * | ff1_up_weight, | ||
| const float * | ff1_up_bias, | ||
| const float * | ff1_down_weight, | ||
| const float * | ff1_down_bias, | ||
| const float * | attn_norm_weight, | ||
| const float * | attn_norm_bias, | ||
| const float * | q_weight, | ||
| const float * | q_bias, | ||
| const float * | k_weight, | ||
| const float * | k_bias, | ||
| const float * | v_weight, | ||
| const float * | v_bias, | ||
| const float * | relative_weight, | ||
| const float * | attn_bias_u, | ||
| const float * | attn_bias_v, | ||
| const float * | attn_out_weight, | ||
| const float * | attn_out_bias, | ||
| const float * | conv_norm_weight, | ||
| const float * | conv_norm_bias, | ||
| const float * | conv_pw1_weight, | ||
| const float * | conv_pw1_bias, | ||
| const float * | conv_dw_weight, | ||
| const float * | conv_dw_bias, | ||
| const float * | conv_bn_mean, | ||
| const float * | conv_bn_variance, | ||
| const float * | conv_bn_weight, | ||
| const float * | conv_bn_bias, | ||
| const float * | conv_pw2_weight, | ||
| const float * | conv_pw2_bias, | ||
| const float * | ff2_norm_weight, | ||
| const float * | ff2_norm_bias, | ||
| const float * | ff2_up_weight, | ||
| const float * | ff2_up_bias, | ||
| const float * | ff2_down_weight, | ||
| const float * | ff2_down_bias, | ||
| const float * | out_norm_weight, | ||
| const float * | out_norm_bias, | ||
| float * | output, | ||
| void * | workspace, | ||
| size_t | workspace_bytes, | ||
| int | frames, | ||
| int | hidden_size, | ||
| int | intermediate_size, | ||
| int | heads, | ||
| int | head_dim, | ||
| int | conv_kernel_size, | ||
| float | layer_norm_epsilon, | ||
| float | batch_norm_epsilon | ||
| ) |
Definition at line 1928 of file audio_kernels.c.
References audio_batch_norm_inference_channel_major_f32(), audio_conformer_relative_attention_f32(), audio_conv1d_channel_major_grouped_f32(), audio_fastconformer_block_workspace_bytes_for_score_slots(), audio_glu_split_channel_major_f32(), audio_scaled_residual_add_f32(), gemm_nt_f32_llama_production_parallel_dispatch(), layernorm_naive_serial_matched_precision(), and recurrent_silu_forward().
| size_t audio_fastconformer_block_workspace_bytes | ( | int | frames, |
| int | hidden_size, | ||
| int | intermediate_size, | ||
| int | heads | ||
| ) |
Definition at line 1914 of file audio_kernels.c.
References audio_fastconformer_block_workspace_bytes_for_score_slots(), ck_threadpool_global(), and ck_threadpool_n_threads().
|
static |
Definition at line 1873 of file audio_kernels.c.
References checked_add_size(), and checked_mul_size().
Referenced by audio_fastconformer_block_f32(), and audio_fastconformer_block_workspace_bytes().
| int audio_fastconformer_subsampling_f32 | ( | const float * | features, |
| const float * | conv0_weight, | ||
| const float * | conv0_bias, | ||
| const float * | depthwise1_weight, | ||
| const float * | depthwise1_bias, | ||
| const float * | pointwise1_weight, | ||
| const float * | pointwise1_bias, | ||
| const float * | depthwise2_weight, | ||
| const float * | depthwise2_bias, | ||
| const float * | pointwise2_weight, | ||
| const float * | pointwise2_bias, | ||
| const float * | linear_weight, | ||
| const float * | linear_bias, | ||
| float * | output, | ||
| void * | workspace, | ||
| size_t | workspace_bytes, | ||
| int | feature_frames, | ||
| int | live_frames, | ||
| int | feature_channels, | ||
| int | conv_channels, | ||
| int | hidden_size, | ||
| int | kernel_size, | ||
| int | stride, | ||
| int | output_capacity_frames, | ||
| int * | output_frames | ||
| ) |
Definition at line 1024 of file audio_kernels.c.
References audio_conv2d_whc_grouped_f32(), audio_fastconformer_subsampling_workspace_bytes(), checked_mul_size(), conv_output_extent(), gemm_nt_f32_llama_production_parallel_dispatch(), relu_subsampling_inplace(), and zero_subsampling_padding().
| size_t audio_fastconformer_subsampling_workspace_bytes | ( | int | feature_frames, |
| int | feature_channels, | ||
| int | conv_channels, | ||
| int | kernel_size, | ||
| int | stride | ||
| ) |
Definition at line 967 of file audio_kernels.c.
References checked_mul_size(), and conv_output_extent().
Referenced by audio_fastconformer_subsampling_f32().
| int audio_feature_normalize_per_feature_f32 | ( | const float * | input, |
| float * | output, | ||
| int | channels, | ||
| int | frames, | ||
| float | epsilon | ||
| ) |
Definition at line 398 of file audio_kernels.c.
| int audio_glu_split_channel_major_f32 | ( | const float * | input, |
| float * | output, | ||
| int | channels, | ||
| int | frames | ||
| ) |
Definition at line 1596 of file audio_kernels.c.
References ck_audio_glu_split_f32_range(), ck_threadpool_global(), ck_threadpool_n_threads(), and ck_threadpool_parallel_for_n().
Referenced by audio_fastconformer_block_f32().
| int audio_hann_window_f32 | ( | float * | output, |
| int | frames, | ||
| int | periodic | ||
| ) |
Definition at line 357 of file audio_kernels.c.
References CK_AUDIO_PI_D.
|
static |
Definition at line 596 of file audio_kernels.c.
Referenced by audio_whisper_mel_filters_slaney_f32().
| int audio_log_mel_time_major_f32 | ( | const float * | power, |
| const float * | mel_filters, | ||
| float * | log_mel, | ||
| int | frames, | ||
| int | bins, | ||
| int | channels, | ||
| float | epsilon | ||
| ) |
Definition at line 750 of file audio_kernels.c.
| int audio_lstm_step_f32 | ( | const float * | input, |
| const float * | weight_ih, | ||
| const float * | weight_hh, | ||
| const float * | bias_ih, | ||
| const float * | bias_hh, | ||
| float * | hidden_state, | ||
| float * | cell_state, | ||
| float * | output, | ||
| float * | gates_scratch, | ||
| size_t | gates_scratch_bytes, | ||
| int | input_size, | ||
| int | hidden_size | ||
| ) |
Definition at line 505 of file audio_kernels.c.
Referenced by audio_lstm_bidirectional_scan_f32().
|
static |
Definition at line 604 of file audio_kernels.c.
Referenced by audio_whisper_mel_filters_slaney_f32().
| int audio_pad_or_truncate_f32 | ( | const float * | input, |
| int | input_frames, | ||
| float * | output, | ||
| int | output_frames | ||
| ) |
Definition at line 334 of file audio_kernels.c.
| int audio_pcm_s16_to_mono_f32 | ( | const int16_t * | interleaved, |
| int | n_frames, | ||
| int | n_channels, | ||
| float * | mono | ||
| ) |
Definition at line 230 of file audio_kernels.c.
| int audio_preemphasis_f32 | ( | const float * | input, |
| float * | output, | ||
| int | frames, | ||
| float | coefficient | ||
| ) |
Definition at line 373 of file audio_kernels.c.
| int audio_relative_shift_f32 | ( | const float * | raw_scores, |
| float * | scores, | ||
| int | heads, | ||
| int | query_frames | ||
| ) |
Definition at line 1654 of file audio_kernels.c.
References ck_audio_relative_shift_f32_range(), ck_threadpool_global(), ck_threadpool_n_threads(), and ck_threadpool_parallel_for_n().
| int audio_relative_sinusoidal_position_f32 | ( | float * | output, |
| int | frames, | ||
| int | channels | ||
| ) |
Definition at line 440 of file audio_kernels.c.
| int audio_resample_linear_f32 | ( | const float * | input, |
| int | input_frames, | ||
| int | input_rate, | ||
| float * | output, | ||
| int | output_frames, | ||
| int | output_rate | ||
| ) |
Definition at line 264 of file audio_kernels.c.
References audio_resampled_frame_count(), left, and right.
| int audio_resample_windowed_sinc_f32 | ( | const float * | input, |
| int | input_frames, | ||
| int | input_rate, | ||
| float * | output, | ||
| int | output_frames, | ||
| int | output_rate, | ||
| int | radius | ||
| ) |
Definition at line 289 of file audio_kernels.c.
References audio_resampled_frame_count(), and CK_AUDIO_PI_D.
| int audio_resampled_frame_count | ( | int | input_frames, |
| int | input_rate, | ||
| int | output_rate | ||
| ) |
Definition at line 253 of file audio_kernels.c.
Referenced by audio_resample_linear_f32(), and audio_resample_windowed_sinc_f32().
| int audio_scaled_residual_add_f32 | ( | const float * | residual, |
| const float * | branch, | ||
| float | scale, | ||
| float * | output, | ||
| size_t | elements | ||
| ) |
Definition at line 1852 of file audio_kernels.c.
Referenced by audio_fastconformer_block_f32().
| int audio_stft_power_centered_window_f32 | ( | const float * | samples, |
| int | n_samples, | ||
| const float * | window, | ||
| int | window_length, | ||
| const float * | cos_table, | ||
| const float * | sin_table, | ||
| int | n_fft, | ||
| int | hop_length, | ||
| int | reflect_padding, | ||
| float * | power, | ||
| int | n_frames | ||
| ) |
Definition at line 695 of file audio_kernels.c.
References reflect_index().
| int audio_stft_power_fft400_f32 | ( | const float * | samples, |
| int | n_samples, | ||
| const float * | window, | ||
| const float * | cos_table, | ||
| const float * | sin_table, | ||
| int | hop_length, | ||
| float * | power, | ||
| int | n_frames, | ||
| float * | fft_scratch | ||
| ) |
Definition at line 790 of file audio_kernels.c.
References audio_stft_power_fft400_frame_f32(), CK_AUDIO_WHISPER_HOP_LENGTH, CK_AUDIO_WHISPER_N_FFT, and CK_AUDIO_WHISPER_POWER_BINS.
|
static |
Definition at line 825 of file audio_kernels.c.
References CK_AUDIO_WHISPER_HOP_LENGTH, CK_AUDIO_WHISPER_N_FFT, CK_AUDIO_WHISPER_POWER_BINS, and reflect_index().
Referenced by audio_stft_power_fft400_f32(), and audio_whisper_log_mel_window_wav_pcm16_f32().
| int audio_stft_power_precomputed_f32 | ( | const float * | samples, |
| int | n_samples, | ||
| const float * | window, | ||
| const float * | cos_table, | ||
| const float * | sin_table, | ||
| int | n_fft, | ||
| int | hop_length, | ||
| float * | power, | ||
| int | n_frames | ||
| ) |
Definition at line 651 of file audio_kernels.c.
References reflect_index().
| int audio_stft_precompute_tables_f32 | ( | int | n_fft, |
| float * | window, | ||
| float * | cos_table, | ||
| float * | sin_table | ||
| ) |
Definition at line 567 of file audio_kernels.c.
References CK_AUDIO_PI_F.
| int audio_transpose_channel_to_token_f32 | ( | const float * | input, |
| float * | output, | ||
| int | channels, | ||
| int | frames | ||
| ) |
Definition at line 1831 of file audio_kernels.c.
| int audio_wav_decode_memory_pcm16_mono_f32 | ( | const uint8_t * | bytes, |
| size_t | byte_count, | ||
| float * | mono, | ||
| int | mono_capacity, | ||
| CKAudioWavInfo * | info | ||
| ) |
Definition at line 187 of file audio_kernels.c.
References audio_wav_decode_memory_pcm16_mono_window_f32().
| int audio_wav_decode_memory_pcm16_mono_window_f32 | ( | const uint8_t * | bytes, |
| size_t | byte_count, | ||
| int | start_frame, | ||
| float * | mono, | ||
| int | mono_capacity, | ||
| CKAudioWavInfo * | info | ||
| ) |
Definition at line 198 of file audio_kernels.c.
References audio_wav_parse_memory(), CKAudioWavInfo::channels, CKAudioWavInfo::data_offset, CKAudioWavInfo::frames, and read_u16_le().
Referenced by audio_wav_decode_memory_pcm16_mono_f32().
| int audio_wav_decode_pcm16_mono_f32 | ( | const uint8_t * | bytes, |
| size_t | byte_count, | ||
| const CKAudioWavInfo * | info, | ||
| float * | mono, | ||
| int | mono_capacity | ||
| ) |
Definition at line 159 of file audio_kernels.c.
References CKAudioWavInfo::bits_per_sample, CKAudioWavInfo::channels, CKAudioWavInfo::data_bytes, CKAudioWavInfo::data_offset, CKAudioWavInfo::format_tag, CKAudioWavInfo::frames, and read_u16_le().
Referenced by audio_whisper_log_mel_window_wav_pcm16_f32().
| int audio_wav_parse_memory | ( | const uint8_t * | bytes, |
| size_t | byte_count, | ||
| CKAudioWavInfo * | info | ||
| ) |
Definition at line 98 of file audio_kernels.c.
References CKAudioWavInfo::bits_per_sample, CKAudioWavInfo::channels, CKAudioWavInfo::data_bytes, CKAudioWavInfo::data_offset, CKAudioWavInfo::format_tag, CKAudioWavInfo::frames, read_u16_le(), read_u32_le(), and CKAudioWavInfo::sample_rate.
Referenced by audio_wav_decode_memory_pcm16_mono_window_f32(), and audio_whisper_log_mel_window_wav_pcm16_f32().
| int audio_whisper_log_mel_from_power_reference_f32 | ( | const float * | power, |
| const float * | mel_filters, | ||
| int | n_mels, | ||
| int | n_frames, | ||
| float * | log_mel | ||
| ) |
Definition at line 2214 of file audio_kernels.c.
References CK_AUDIO_WHISPER_POWER_BINS.
Referenced by audio_whisper_log_mel_reference_f32().
| int audio_whisper_log_mel_reference_f32 | ( | const float * | samples, |
| int | n_samples, | ||
| const float * | mel_filters, | ||
| int | n_mels, | ||
| float * | power_scratch, | ||
| float * | log_mel, | ||
| int | n_frames | ||
| ) |
Definition at line 2254 of file audio_kernels.c.
References audio_whisper_log_mel_from_power_reference_f32(), and audio_whisper_stft_power_reference_f32().
| int audio_whisper_log_mel_window_wav_pcm16_f32 | ( | const uint8_t * | bytes, |
| size_t | byte_count, | ||
| int | start_frame, | ||
| int | target_sample_rate, | ||
| const float * | window, | ||
| const float * | cos_table, | ||
| const float * | sin_table, | ||
| const float * | mel_filters, | ||
| int | n_mels, | ||
| int | output_frames, | ||
| float * | log_mel | ||
| ) |
Definition at line 878 of file audio_kernels.c.
References audio_stft_power_fft400_frame_f32(), audio_wav_decode_pcm16_mono_f32(), audio_wav_parse_memory(), CK_AUDIO_WHISPER_HOP_LENGTH, CK_AUDIO_WHISPER_N_FFT, CK_AUDIO_WHISPER_POWER_BINS, CK_AUDIO_WHISPER_SAMPLE_RATE, CKAudioWavInfo::frames, and CKAudioWavInfo::sample_rate.
| int audio_whisper_mel_filters_slaney_f32 | ( | int | sample_rate, |
| int | n_fft, | ||
| int | n_mels, | ||
| float * | mel_filters | ||
| ) |
Definition at line 612 of file audio_kernels.c.
References audio_hz_to_mel_slaney(), audio_mel_to_hz_slaney(), left, and right.
| int audio_whisper_stft_power_reference_f32 | ( | const float * | samples, |
| int | n_samples, | ||
| float * | power, | ||
| int | n_frames | ||
| ) |
Definition at line 2173 of file audio_kernels.c.
References CK_AUDIO_PI_F, CK_AUDIO_WHISPER_HOP_LENGTH, CK_AUDIO_WHISPER_N_FFT, CK_AUDIO_WHISPER_POWER_BINS, and reflect_index().
Referenced by audio_whisper_log_mel_reference_f32().
|
static |
Definition at line 57 of file audio_kernels.c.
Referenced by audio_fastconformer_block_workspace_bytes_for_score_slots().
|
static |
Definition at line 48 of file audio_kernels.c.
Referenced by audio_fastconformer_block_workspace_bytes_for_score_slots(), audio_fastconformer_subsampling_f32(), and audio_fastconformer_subsampling_workspace_bytes().
|
static |
Definition at line 1705 of file audio_kernels.c.
References ck_threadpool_thread_id(), end, and score.
Referenced by audio_conformer_relative_attention_f32().
|
static |
Definition at line 1199 of file audio_kernels.c.
Referenced by audio_conv1d_channel_major_grouped_f32().
|
static |
Definition at line 1410 of file audio_kernels.c.
References end.
Referenced by audio_conv2d_whc_grouped_f32().
|
static |
Definition at line 1585 of file audio_kernels.c.
References end.
Referenced by audio_glu_split_channel_major_f32().
|
static |
Definition at line 1636 of file audio_kernels.c.
References end.
Referenced by audio_relative_shift_f32().
|
static |
Definition at line 66 of file audio_kernels.c.
Referenced by audio_fastconformer_subsampling_f32(), and audio_fastconformer_subsampling_workspace_bytes().
| void gemm_nt_f32_llama_production_parallel_dispatch | ( | const float * | A, |
| const float * | B, | ||
| const float * | bias, | ||
| float * | C, | ||
| int | M, | ||
| int | N, | ||
| int | K | ||
| ) |
Referenced by audio_fastconformer_block_f32(), and audio_fastconformer_subsampling_f32().
| void layernorm_naive_serial_matched_precision | ( | const float * | input, |
| const float * | gamma, | ||
| const float * | beta, | ||
| float * | output, | ||
| float * | mean_cache, | ||
| float * | rstd_cache, | ||
| int | tokens, | ||
| int | d_model, | ||
| float | eps | ||
| ) |
Definition at line 764 of file layernorm_kernels.c.
Referenced by audio_fastconformer_block_f32(), and layernorm_forward_unrolled_slice_scalar().
|
static |
Definition at line 87 of file audio_kernels.c.
Referenced by audio_wav_decode_memory_pcm16_mono_window_f32(), audio_wav_decode_pcm16_mono_f32(), and audio_wav_parse_memory().
|
static |
Definition at line 92 of file audio_kernels.c.
Referenced by audio_wav_parse_memory().
| void recurrent_silu_forward | ( | const float * | input, |
| float * | output, | ||
| int | rows, | ||
| int | dim | ||
| ) |
Definition at line 138 of file recurrent_gate_kernels.c.
Referenced by audio_fastconformer_block_f32().
|
static |
Definition at line 75 of file audio_kernels.c.
Referenced by audio_stft_power_centered_window_f32(), audio_stft_power_fft400_frame_f32(), audio_stft_power_precomputed_f32(), and audio_whisper_stft_power_reference_f32().
|
static |
Definition at line 1015 of file audio_kernels.c.
Referenced by audio_fastconformer_subsampling_f32().
|
static |
Definition at line 996 of file audio_kernels.c.
Referenced by audio_fastconformer_subsampling_f32().