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 branches found
No related tags found
No related merge requests found
Pipeline #35913 failed
import subprocess import subprocess
import numpy as np import numpy as np
import sympy as sp import sympy as sp
import tempfile
import pystencils as ps import pystencils as ps
from pystencils_benchmark import generate_benchmark, Compiler
from pathlib import Path from pathlib import Path
from pystencils_benchmark import generate_benchmark, Compiler
def test_generate(): 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)) a, b, c = ps.fields(a=np.ones(4000000), b=np.ones(4000000), c=np.ones(4000000))
alpha = sp.symbols('alpha') alpha = sp.symbols('alpha')
...@@ -23,7 +22,10 @@ def test_generate(): ...@@ -23,7 +22,10 @@ def test_generate():
kernel_daxpy = ps.create_kernel(**daxpy) kernel_daxpy = ps.create_kernel(**daxpy)
for compiler in [Compiler.GCC, Compiler.GCCdebug, Compiler.Clang]: for compiler in [Compiler.GCC, Compiler.GCCdebug, Compiler.Clang]:
generate_benchmark([kernel_vadd, kernel_daxpy], path, compiler=compiler) with tempfile.TemporaryDirectory(dir=Path.cwd()) as temp_dir:
subprocess.run(['make', '-C', f'{path}'], check=True) temp_dir = Path(temp_dir)
subprocess.run([f'{path}/benchmark-{compiler.name}', '10'], check=True) 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 subprocess
import numpy as np import numpy as np
import sympy as sp import sympy as sp
import tempfile
import pystencils as ps import pystencils as ps
from pystencils_benchmark import generate_benchmark, Compiler
from pathlib import Path from pathlib import Path
from pystencils_benchmark import generate_benchmark, Compiler
def test_generate(): 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)) a, b, c = ps.fields(a=np.ones(4000000), b=np.ones(4000000), c=np.ones(4000000))
alpha = sp.symbols('alpha') alpha = sp.symbols('alpha')
...@@ -23,7 +22,10 @@ def test_generate(): ...@@ -23,7 +22,10 @@ def test_generate():
kernel_daxpy = ps.create_kernel(**daxpy) kernel_daxpy = ps.create_kernel(**daxpy)
for compiler in [Compiler.GCC, Compiler.GCCdebug, Compiler.Clang]: for compiler in [Compiler.GCC, Compiler.GCCdebug, Compiler.Clang]:
generate_benchmark([kernel_vadd, kernel_daxpy], path, compiler=compiler) with tempfile.TemporaryDirectory(dir=Path.cwd()) as temp_dir:
subprocess.run(['make', '-C', f'{path}'], check=True) temp_dir = Path(temp_dir)
subprocess.run([f'{path}/benchmark-{compiler.name}', '10'], check=True) 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% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment