From 3300460d08ee976674a331b01545207d1511d020 Mon Sep 17 00:00:00 2001
From: Christoph Alt <christoph.alt@fau.de>
Date: Tue, 8 Aug 2023 13:41:28 +0200
Subject: [PATCH] made the gpu test more streamlined with the cpu tests

---
 tests/test_benchmark.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tests/test_benchmark.py b/tests/test_benchmark.py
index 6e2dbf8..48207da 100755
--- a/tests/test_benchmark.py
+++ b/tests/test_benchmark.py
@@ -48,7 +48,8 @@ def test_generate_gpu():
         a[0] @= b[0] + c[0]
     kernel_vadd = ps.create_kernel(**vadd)
 
-    temp_dir = Path('/tmp/pystencils_benchmark_testfolder')
-    generate_benchmark_gpu([kernel_vadd], temp_dir, compiler=compiler)
-    # subprocess.run(['make', '-C', f'{temp_dir}'], check=True)
-    # subprocess.run([f'{temp_dir}/benchmark-{compiler.name}', '10'], check=True)
+    with tempfile.TemporaryDirectory(dir=Path.cwd()) as temp_dir:
+        temp_dir = Path(temp_dir)
+        generate_benchmark_gpu(kernel_vadd, temp_dir, compiler=compiler)
+        # subprocess.run(['make', '-C', f'{temp_dir}'], check=True)
+        # subprocess.run([f'{temp_dir}/benchmark-{compiler.name}', '10'], check=True)
-- 
GitLab