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

Function transpose

utils/array_utils.hpp:268–274  ·  view source on GitHub ↗

* @brief Transpose a matrix. * @param input The input matrix. * @param output The output matrix. * @param M The number of rows in the input matrix. * @param N The number of columns in the input matrix. */

Source from the content-addressed store, hash-verified

266 * @param N The number of columns in the input matrix.
267 */
268inline void transpose(float *input, float *output, size_t M, size_t N) {
269 for (size_t i = 0; i < M; i++) {
270 for (size_t j = 0; j < N; j++) {
271 output[j * M + i] = input[i * N + j];
272 }
273 }
274}
275
276inline void transpose(half *input, half *output, size_t M, size_t N) {
277 for (size_t i = 0; i < M; i++) {

Callers 3

runTestWithCheckFunction · 0.85
runTestFunction · 0.85
testMatmulFunction · 0.85

Calls

no outgoing calls

Tested by 1

testMatmulFunction · 0.68