Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions native/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
BENCHMARKS = fft_cdp-in-c fft_cdp-in-nc fft_cdp-out-c \
fft_cdp-out-nc fft_rdp-out-c fft_rdp-out-nc \
rfft_rdp-out-c rfft_rdp-out-nc \
fft_rdp2-out-c fft2_cdp-in-c fft2_cdp-in-nc \
fft3_cdp-in-c fft3_cdp-in-nc fft2_cdp-out-c \
fft2_cdp-out-nc fft3_cdp-out-c fft3_cdp-out-nc
fft_cdp-out-nc fft_rdp-out-c fft_rdp-out-nc \
rfft_rdp-out-c rfft_rdp-out-nc \
fft_rdp2-out-c fft2_cdp-in-c fft2_cdp-in-nc \
fft3_cdp-in-c fft3_cdp-in-nc fft2_cdp-out-c \
fft2_cdp-out-nc fft3_cdp-out-c fft3_cdp-out-nc

CC = icc
CFLAGS = -m64 -fPIC -fp-model strict -O3 -g -fomit-frame-pointer \
-DNDEBUG -qopenmp -xSSE4.2 -axCORE-AVX2,COMMON-AVX512 \
-lmkl_rt
-DNDEBUG -qopenmp -xSSE4.2 -axCORE-AVX2,COMMON-AVX512 \
-lmkl_rt

CINCLUDE := $(addprefix -I,$(CINCLUDE))

Expand Down
16 changes: 9 additions & 7 deletions native/fft2_cdp-out-c.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ int main() {
mkl_free(re_vec);
mkl_free(im_vec);

buf = (MKL_Complex16 *) mkl_malloc(N * sizeof(MKL_Complex16), 64);
assert(buf);

warm_up_threads();

for(si=0; si < samps; time_tot=0, si++) {

t0 = moment_now();

buf = (MKL_Complex16 *) mkl_malloc(N * sizeof(MKL_Complex16), 64);
assert(buf);

status = DftiCreateDescriptor(
&hand,
DFTI_DOUBLE,
Expand Down Expand Up @@ -115,16 +115,18 @@ int main() {
status = DftiFreeDescriptor(&hand);
assert(status == 0);

if (si == 0) {
#include "print_buf.inc"
}

mkl_free(buf);

t1 = moment_now();
time_tot += t1 - t0;

printf("%.5g\n", seconds_from_moment(time_tot));
}

#include "print_buf.inc"

mkl_free(buf);

err = vslDeleteStream(&stream);
assert(err == VSL_STATUS_OK);

Expand Down
16 changes: 9 additions & 7 deletions native/fft2_cdp-out-nc.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,16 @@ int main() {
strides[1] = N2;
strides[2] = 1;

buf = (MKL_Complex16 *) mkl_malloc(N * sizeof(MKL_Complex16), 64);
assert(buf);

warm_up_threads();

for(si=0; si < samps; time_tot=0, si++) {

for(it = -1; it <reps; it++) {
t0 = moment_now();

buf = (MKL_Complex16 *) mkl_malloc(N * sizeof(MKL_Complex16), 64);
assert(buf);

status = DftiCreateDescriptor(
&hand,
DFTI_DOUBLE,
Expand Down Expand Up @@ -104,6 +104,12 @@ int main() {
status = DftiFreeDescriptor(&hand);
assert(status == 0);

if (si == 0 && it == -1) {
#include "print_buf.inc"
}

mkl_free(buf);

t1 = moment_now();

if (it >= 0) time_tot += t1 - t0;
Expand All @@ -112,10 +118,6 @@ int main() {
printf("%.5g\n", seconds_from_moment(time_tot));
}

#include "print_buf.inc"

mkl_free(buf);

err = vslDeleteStream(&stream);
assert(err == VSL_STATUS_OK);

Expand Down
10 changes: 6 additions & 4 deletions native/fft3_cdp-out-c.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,18 @@ int main() {
status = DftiFreeDescriptor(&hand);
assert(status == 0);

if (si == 0) {
#include "print_buf.inc"
}

mkl_free(buf);

t1 = moment_now();
time_tot += t1 - t0;

printf("%.5g\n", seconds_from_moment(time_tot));
}

#include "print_buf.inc"

mkl_free(buf);

err = vslDeleteStream(&stream);
assert(err == VSL_STATUS_OK);

Expand Down
16 changes: 9 additions & 7 deletions native/fft3_cdp-out-nc.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ int main() {
mkl_free(re_vec);
mkl_free(im_vec);

buf = (MKL_Complex16 *) mkl_malloc(N * sizeof(MKL_Complex16), 64);
assert(buf);

strides[0] = 0;
strides[1] = N3 * N2;
strides[2] = N3;
Expand All @@ -75,6 +72,9 @@ int main() {

t0 = moment_now();

buf = (MKL_Complex16 *) mkl_malloc(N * sizeof(MKL_Complex16), 64);
assert(buf);

status = DftiCreateDescriptor(
&hand,
DFTI_DOUBLE,
Expand Down Expand Up @@ -105,17 +105,19 @@ int main() {
status = DftiFreeDescriptor(&hand);
assert(status == 0);

if (si == 0 && it == -1) {
#include "print_buf.inc"
}

mkl_free(buf);

t1 = moment_now();
if(it >= 0) time_tot += t1 - t0;
}

printf("%.5g\n", seconds_from_moment(time_tot));
}

#include "print_buf.inc"

mkl_free(buf);

err = vslDeleteStream(&stream);
assert(err == VSL_STATUS_OK);

Expand Down
15 changes: 9 additions & 6 deletions native/fft_cdp-out-c.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ int main() {
mkl_free(re_vec);
mkl_free(im_vec);

buf = (MKL_Complex16 *) mkl_malloc(N * sizeof(MKL_Complex16), 64);
assert(buf);

warm_up_threads();

for(si=0; si < samps; time_tot=0, si++) {

t0 = moment_now();

buf = (MKL_Complex16 *) mkl_malloc(N * sizeof(MKL_Complex16), 64);
assert(buf);

status = DftiCreateDescriptor(
&hand,
DFTI_DOUBLE,
Expand Down Expand Up @@ -94,18 +94,21 @@ int main() {
status = DftiFreeDescriptor(&hand);
assert(status == 0);

if (si == 0) {
#include "print_buf.inc"
}

mkl_free(buf);

t1 = moment_now();
time_tot += t1 - t0;

printf("%.5g\n", seconds_from_moment(time_tot));
}

#include "print_buf.inc"

err = vslDeleteStream(&stream);
assert(err == VSL_STATUS_OK);

mkl_free(buf);
mkl_free(x);

return 0;
Expand Down
15 changes: 9 additions & 6 deletions native/fft_cdp-out-nc.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ int main() {
mkl_free(re_vec);
mkl_free(im_vec);

buf = (MKL_Complex16 *) mkl_malloc(N * sizeof(MKL_Complex16), 64);
assert(buf);

warm_up_threads();

for(si=0; si < samps; time_tot=0, si++) {
Expand All @@ -62,6 +59,9 @@ int main() {

t0 = moment_now();

buf = (MKL_Complex16 *) mkl_malloc(N * sizeof(MKL_Complex16), 64);
assert(buf);

status = DftiCreateDescriptor(
&hand,
DFTI_DOUBLE,
Expand All @@ -82,19 +82,22 @@ int main() {
status = DftiFreeDescriptor(&hand);
assert(status == 0);

if (si == 0 && it == -1) {
#include "print_buf.inc"
}

mkl_free(buf);

t1 = moment_now();
if (it >= 0) time_tot += t1 - t0;
}

printf("%.5g\n", seconds_from_moment(time_tot));
}

#include "print_buf.inc"

err = vslDeleteStream(&stream);
assert(err == VSL_STATUS_OK);

mkl_free(buf);
mkl_free(x);

return 0;
Expand Down
15 changes: 9 additions & 6 deletions native/fft_rdp-out-c.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ int main() {
err = vdRngGaussian(VSL_RNG_METHOD_GAUSSIAN_ICDF, stream, N, x, d_zero, d_one);
assert(err == VSL_STATUS_OK);

buf = (MKL_Complex16 *) mkl_malloc(N * sizeof(MKL_Complex16), 64);
assert(buf);

warm_up_threads();

for(si = 0; si < samps; time_tot=0, si++) {
t0 = moment_now();

buf = (MKL_Complex16 *) mkl_malloc(N * sizeof(MKL_Complex16), 64);
assert(buf);

status = DftiCreateDescriptor(
&hand,
DFTI_DOUBLE,
Expand Down Expand Up @@ -89,18 +89,21 @@ int main() {
status = DftiFreeDescriptor(&hand);
assert(status == 0);

if (si == 0) {
#include "print_buf.inc"
}

mkl_free(buf);

t1 = moment_now();
time_tot += t1 - t0;

printf("%.5g\n", seconds_from_moment(time_tot));
}

#include "print_buf.inc"

err = vslDeleteStream(&stream);
assert(err == VSL_STATUS_OK);

mkl_free(buf);
mkl_free(x);

return 0;
Expand Down
21 changes: 12 additions & 9 deletions native/fft_rdp-out-nc.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,14 @@ int main() {
#define DESCRIPTION_STR "Real double, not in-place, not cached"
#include "read_n_echo_env.inc"

err = vslNewStream(&stream, VSL_BRNG_MT19937, SEED);
assert(err == VSL_STATUS_OK);

x = (double *) mkl_malloc(N * sizeof(double), 64);
assert(x);

err = vdRngGaussian(VSL_RNG_METHOD_GAUSSIAN_ICDF, stream, N, x, d_zero, d_one);
err = vslNewStream(&stream, VSL_BRNG_MT19937, SEED);
assert(err == VSL_STATUS_OK);

buf = (MKL_Complex16 *) mkl_malloc(N * sizeof(MKL_Complex16), 64);
assert(buf);
err = vdRngGaussian(VSL_RNG_METHOD_GAUSSIAN_ICDF, stream, N, x, d_zero, d_one);
assert(err == VSL_STATUS_OK);

warm_up_threads();

Expand All @@ -46,6 +43,9 @@ int main() {

t0 = moment_now();

buf = (MKL_Complex16 *) mkl_malloc(N * sizeof(MKL_Complex16), 64);
assert(buf);

status = DftiCreateDescriptor(
&hand,
DFTI_DOUBLE,
Expand Down Expand Up @@ -77,6 +77,12 @@ int main() {
status = DftiFreeDescriptor(&hand);
assert(status == 0);

if (si == 0 && it == -1) {
#include "print_buf.inc"
}

mkl_free(buf);

t1 = moment_now();

if (it >= 0) time_tot += t1 - t0;
Expand All @@ -85,12 +91,9 @@ int main() {
printf("%.5g\n", seconds_from_moment(time_tot));
}

#include "print_buf.inc"

err = vslDeleteStream(&stream);
assert(err == VSL_STATUS_OK);

mkl_free(buf);
mkl_free(x);

return 0;
Expand Down
Loading