]> foleosoft.com Git - QAnsel.git/commitdiff
Tue Mar 5 10:05:44 PM EST 2024
authormiha-q <>
Wed, 6 Mar 2024 03:05:44 +0000 (22:05 -0500)
committermiha-q <>
Wed, 6 Mar 2024 03:05:44 +0000 (22:05 -0500)
src/QAnsel.c

index 8c2fc6d4574fbe29f1ab453208204f9d9ac7b6bb..4d02996827e9232f5b42a69836fc8b6aceb0639e 100644 (file)
@@ -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();