From: miha-q <> Date: Mon, 4 Mar 2024 23:11:25 +0000 (-0500) Subject: Mon Mar 4 06:11:25 PM EST 2024 X-Git-Url: http://www.foleosoft.com/?a=commitdiff_plain;h=58709eee3a938181b179c721539e443691a98e57;p=QAnsel.git Mon Mar 4 06:11:25 PM EST 2024 --- diff --git a/src/QAnsel.c b/src/QAnsel.c index 101edc3..e501f37 100644 --- a/src/QAnsel.c +++ b/src/QAnsel.c @@ -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