From: miha-q <> Date: Wed, 6 Mar 2024 03:05:44 +0000 (-0500) Subject: Tue Mar 5 10:05:44 PM EST 2024 X-Git-Url: http://www.foleosoft.com/?a=commitdiff_plain;h=eb36c62eeab6bab41079b64dc64c3c628076ad87;p=QAnsel.git Tue Mar 5 10:05:44 PM EST 2024 --- 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();