mirror of
https://github.com/andreinechaev/nvcc4jupyter.git
synced 2026-06-15 19:50:50 +05:30
Add test to compile with opencv
This commit is contained in:
Vendored
+8
@@ -0,0 +1,8 @@
|
|||||||
|
#include <opencv2/core.hpp>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
std::cout << cv::getBuildInformation() << std::endl;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Vendored
+5
@@ -37,6 +37,11 @@ def compiler_cpp_17_fpath(fixtures_path: str):
|
|||||||
return os.path.join(fixtures_path, "compiler", "cpp_17.cu")
|
return os.path.join(fixtures_path, "compiler", "cpp_17.cu")
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope="session")
|
||||||
|
def compiler_opencv_fpath(fixtures_path: str):
|
||||||
|
return os.path.join(fixtures_path, "compiler", "opencv.cu")
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def sample_magic_cu_line():
|
def sample_magic_cu_line():
|
||||||
# fmt: off
|
# fmt: off
|
||||||
|
|||||||
@@ -120,6 +120,36 @@ def test_compile_args(
|
|||||||
assert "errors detected in the compilation of" in output
|
assert "errors detected in the compilation of" in output
|
||||||
|
|
||||||
|
|
||||||
|
def test_compile_opencv(
|
||||||
|
plugin: NVCCPlugin,
|
||||||
|
compiler_opencv_fpath: str,
|
||||||
|
):
|
||||||
|
gname = "test_compile_opencv"
|
||||||
|
copy_source_to_group(compiler_opencv_fpath, gname, plugin.workdir)
|
||||||
|
|
||||||
|
# check that "pkg-config" exists
|
||||||
|
assert subprocess.check_call(["which", "pkg-config"]) == 0
|
||||||
|
|
||||||
|
opencv_compile_options = (
|
||||||
|
subprocess.check_output(
|
||||||
|
args=["pkg-config", "--cflags", "--libs", "opencv4"]
|
||||||
|
)
|
||||||
|
.decode()
|
||||||
|
.strip()
|
||||||
|
)
|
||||||
|
|
||||||
|
output = plugin._compile_and_run(
|
||||||
|
group_name=gname,
|
||||||
|
args=argparse.Namespace(
|
||||||
|
timeit=False,
|
||||||
|
profile=True,
|
||||||
|
profiler_args="",
|
||||||
|
compiler_args=opencv_compile_options,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
assert "General configuration for OpenCV" in output
|
||||||
|
|
||||||
|
|
||||||
def test_run(
|
def test_run(
|
||||||
plugin: NVCCPlugin,
|
plugin: NVCCPlugin,
|
||||||
sample_cuda_fpath: str,
|
sample_cuda_fpath: str,
|
||||||
|
|||||||
Reference in New Issue
Block a user