]> foleosoft.com Git - QAnsel.git/commitdiff
Mon Mar 4 06:11:25 PM EST 2024
authormiha-q <>
Mon, 4 Mar 2024 23:11:25 +0000 (18:11 -0500)
committermiha-q <>
Mon, 4 Mar 2024 23:11:25 +0000 (18:11 -0500)
src/QAnsel.c

index 101edc34218e8061fbd0c0b74e5a3a7c99b20701..e501f37c8f687fb91602a843550ff482e9e120d6 100644 (file)
@@ -212,6 +212,22 @@ void qansel_instruction(cpx_mtx_t* stateVector, unsigned char qubitCount, QInstr
                tmp.cols = filter.cols * gate.cols;
                tmp.ptr = malloc(tmp.rows * (tmp.cols * 2) * sizeof(float));
 
+
+               printf("%ix%i (knk)\n", tmp.rows, tmp.cols);
+               unsigned long int us1, us2;
+               us1 = get_time();
+               cpx_mtx_knk_metal(tmp.ptr, filter.ptr, gate.ptr, filter.rows, filter.cols, gate.rows, gate.cols);
+               us2 = get_time();
+               printf("\tMetal: %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();
+               printf("\tThreads: %lu\n", us2 - us1);
+               us1 = get_time();
+               cpx_mtx_knk(tmp.ptr, filter.ptr, gate.ptr, filter.rows, filter.cols, gate.rows, gate.cols);
+               us2 = get_time();
+               printf("\tBare: %lu\n", us2 - us1);
+
                #ifdef SPEED_TEST
                printf("%ix%i (knk)\n", tmp.rows, tmp.cols);
                unsigned long int us1, us2;
@@ -228,18 +244,6 @@ void qansel_instruction(cpx_mtx_t* stateVector, unsigned char qubitCount, QInstr
                us2 = get_time();
                printf("\tBare: %lu\n", us2 - us1);
                #else
-               if (USE_GPU && 0)
-               {
-                       cpx_mtx_knk_metal(tmp.ptr, filter.ptr, gate.ptr, filter.rows, filter.cols, gate.rows, gate.cols);
-               }
-               else if (USE_THREADS)
-               {
-                       cpx_mtx_knk_threads(tmp.ptr, filter.ptr, gate.ptr, filter.rows, filter.cols, gate.rows, gate.cols);
-               }
-               else
-               {
-                       cpx_mtx_knk(tmp.ptr, filter.ptr, gate.ptr, filter.rows, filter.cols, gate.rows, gate.cols);
-               }
                #endif