From eb36c62eeab6bab41079b64dc64c3c628076ad87 Mon Sep 17 00:00:00 2001 From: miha-q <> Date: Tue, 5 Mar 2024 22:05:44 -0500 Subject: [PATCH] Tue Mar 5 10:05:44 PM EST 2024 --- src/QAnsel.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/QAnsel.c b/src/QAnsel.c index 8c2fc6d..4d02996 100644 --- a/src/QAnsel.c +++ b/src/QAnsel.c @@ -223,6 +223,22 @@ void qansel_instruction(cpx_mtx_t* stateVector, unsigned char qubitCount, QInstr cpx_mtx_knk_metal_2(tmp.ptr, filter.ptr, gate.ptr, filter.rows, filter.cols, gate.rows, gate.cols); us2 = get_time(); printf("\tMetal2: %lu\n", us2 - us1); + + us1 = get_time(); + for (int i = 0; i < filter.rows; i++) + { + for (int j = 0; j < filter.cols; j++) + { + int x = (j * 2) + (i * filter.cols * 2); + int y = (i * 2) + (j * filter.cols * 2); + filter.ptr[x] = filter.ptr[y]; + filter.ptr[x + 1] = filter.ptr[y + 1]; + } + } + us2 = get_time(); + printf("\tTranspose: %lu\n", us2 - us1); + + us1 = get_time(); cpx_mtx_knk_threads(tmp.ptr, filter.ptr, gate.ptr, filter.rows, filter.cols, gate.rows, gate.cols); us2 = get_time(); -- 2.39.5