MCPcopy Create free account
hub / github.com/AnswerDotAI/gpu.cpp / range

Function range

utils/array_utils.hpp:150–157  ·  view source on GitHub ↗

* @brief Populate the array with a range of values. This is mostly for testing * purposes. * @param input The array to populate. * @param N The number of elements in the array. * @param start The starting value. * @param step The step size. */

Source from the content-addressed store, hash-verified

148 * @param step The step size.
149 */
150void range(float *input, size_t N, float start = 0.0, float step = 1.0) {
151 // TODO(avh): currently unused - check
152 float curr = start;
153 for (size_t i = 0; i < N; i++) {
154 input[i] = curr;
155 curr += step;
156 }
157}
158
159/**
160 * @brief Overload of `range()` for std::array.

Callers 4

createTransformerFunction · 0.85
testResidualFunction · 0.85
testHadamardFunction · 0.85
testMatmulFunction · 0.85

Calls

no outgoing calls

Tested by 3

testResidualFunction · 0.68
testHadamardFunction · 0.68
testMatmulFunction · 0.68