From 58709eee3a938181b179c721539e443691a98e57 Mon Sep 17 00:00:00 2001 From: miha-q <> Date: Mon, 4 Mar 2024 18:11:25 -0500 Subject: [PATCH] Mon Mar 4 06:11:25 PM EST 2024 --- src/QAnsel.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) 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 -- 2.39.5