Add tests for choosing the profiler

This commit is contained in:
Cosmin Ștefan Ciocan
2024-02-01 14:55:17 +00:00
parent 8d39ce01c3
commit 2c108442f6
4 changed files with 64 additions and 60 deletions
+13
View File
@@ -1,9 +1,11 @@
import argparse
import glob
import os
import pytest
from IPython.core.interactiveshell import InteractiveShell
from nvcc4jupyter.parsers import Profiler
from nvcc4jupyter.plugin import NVCCPlugin
@@ -70,3 +72,14 @@ def multiple_source_fpaths(fixtures_path: str):
pattern_h = os.path.join(fixtures_path, "multiple_files", "*.h")
pattern_cu = os.path.join(fixtures_path, "multiple_files", "*.cu")
return list(glob.glob(pattern_h)) + list(glob.glob(pattern_cu))
@pytest.fixture(scope="session")
def default_args():
return argparse.Namespace(
timeit=False,
profile=True,
profiler=lambda: Profiler.NCU,
profiler_args=lambda: "",
compiler_args=lambda: "",
)
+2 -2
View File
@@ -1,7 +1,7 @@
#!/bin/bash
echo "[NCU]"
# this is a mock of nsight compute cli tool that just executes the program
# given as the last argument
"${@: -1}"
echo "==WARNING== No kernels were profiled"
Vendored Executable
+7
View File
@@ -0,0 +1,7 @@
#!/bin/bash
echo "[NSYS]"
# this is a mock of nsight systems cli tool that just executes the program
# given as the last argument
"${@: -1}"