8 size_t input_stride,
float *output,
size_t output_elements,
9 size_t output_stride,
float *scratch,
size_t scratch_elements,
10 size_t rows,
size_t channels) {
11 size_t input_span, output_span, staged;
14 rows > SIZE_MAX / channels || rows * channels > SIZE_MAX /
sizeof(
float))
16 staged = rows * channels;
17 if (input_elements < input_span || output_elements < output_span ||
18 scratch_elements < staged)
27 for (
size_t r = 0; r < rows; ++r)
29 for (
size_t r = 0; r < rows; ++r)
30 memcpy(scratch + r * channels, input + r * input_stride,
31 channels *
sizeof(
float));
34 for (
size_t r = 0; r < rows; ++r)
35 memcpy(output + r * output_stride, scratch + r * channels,
36 channels *
sizeof(
float));
int gelu_rows_erf_checked_f32(const float *input, size_t input_elements, size_t input_stride, float *output, size_t output_elements, size_t output_stride, float *scratch, size_t scratch_elements, size_t rows, size_t channels)