Skip to content
Snippets Groups Projects
Commit d5ffb380 authored by Jan Hönig's avatar Jan Hönig
Browse files

WIP

parent d5b71d4b
No related merge requests found
Pipeline #35913 failed with stages
in 1 minute and 39 seconds
import subprocess
import numpy as np
import sympy as sp
import tempfile
import pystencils as ps
from pystencils_benchmark import generate_benchmark, Compiler
from pathlib import Path
from pystencils_benchmark import generate_benchmark, Compiler
def test_generate():
path = Path.cwd() / 'test'
path.mkdir(parents=True, exist_ok=True)
a, b, c = ps.fields(a=np.ones(4000000), b=np.ones(4000000), c=np.ones(4000000))
alpha = sp.symbols('alpha')
......@@ -23,7 +22,10 @@ def test_generate():
kernel_daxpy = ps.create_kernel(**daxpy)
for compiler in [Compiler.GCC, Compiler.GCCdebug, Compiler.Clang]:
generate_benchmark([kernel_vadd, kernel_daxpy], path, compiler=compiler)
subprocess.run(['make', '-C', f'{path}'], check=True)
subprocess.run([f'{path}/benchmark-{compiler.name}', '10'], check=True)
with tempfile.TemporaryDirectory(dir=Path.cwd()) as temp_dir:
temp_dir = Path(temp_dir)
generate_benchmark([kernel_vadd, kernel_daxpy], temp_dir, compiler=compiler)
subprocess.run(['make', '-C', f'{temp_dir}'], check=True)
subprocess.run([f'{temp_dir}/benchmark-{compiler.name}', '10'], check=True)
import subprocess
import numpy as np
import sympy as sp
import tempfile
import pystencils as ps
from pystencils_benchmark import generate_benchmark, Compiler
from pathlib import Path
from pystencils_benchmark import generate_benchmark, Compiler
def test_generate():
path = Path.cwd() / 'test'
path.mkdir(parents=True, exist_ok=True)
a, b, c = ps.fields(a=np.ones(4000000), b=np.ones(4000000), c=np.ones(4000000))
alpha = sp.symbols('alpha')
......@@ -23,7 +22,10 @@ def test_generate():
kernel_daxpy = ps.create_kernel(**daxpy)
for compiler in [Compiler.GCC, Compiler.GCCdebug, Compiler.Clang]:
generate_benchmark([kernel_vadd, kernel_daxpy], path, compiler=compiler)
subprocess.run(['make', '-C', f'{path}'], check=True)
subprocess.run([f'{path}/benchmark-{compiler.name}', '10'], check=True)
with tempfile.TemporaryDirectory(dir=Path.cwd()) as temp_dir:
temp_dir = Path(temp_dir)
generate_benchmark([kernel_vadd, kernel_daxpy], temp_dir, compiler=compiler)
subprocess.run(['make', '-C', f'{temp_dir}'], check=True)
subprocess.run([f'{temp_dir}/benchmark-{compiler.name}', '10'], check=True)
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment