Skip to content

Commit

Permalink
issue #106: add debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanArzumanyan committed Sep 19, 2024
1 parent 249e602 commit cd63599
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

skbuild.setup(
name="python_vali",
version="4.1.2-0",
version="106",
description="Video Processing Library with full NVENC/NVDEC hardware acceleration",
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
Expand Down
6 changes: 6 additions & 0 deletions src/TC/src/TaskCudaDownloadSurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include "MemoryInterfaces.hpp"
#include "Tasks.hpp"

#include "iostream"

auto const cuda_stream_sync = [](void* stream) {
LibCuda::cuStreamSynchronize((CUstream)stream);
};
Expand All @@ -40,6 +42,10 @@ TaskExecDetails CudaDownloadSurface::Run() {
TaskExecInfo::INVALID_INPUT, "empty dst");
}

std::cout << __FILE__ << "::" << __FUNCTION__ << "\n";
std::cout << "buffer size: " << dst_buffer->GetRawMemSize() << "\n";
std::cout << "surface size: " << src_surface->HostMemSize() << "\n";

if (dst_buffer->GetRawMemSize() != src_surface->HostMemSize()) {
return TaskExecDetails(TaskExecStatus::TASK_EXEC_FAIL,
TaskExecInfo::SRC_DST_SIZE_MISMATCH,
Expand Down
2 changes: 1 addition & 1 deletion src/python_vali/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
__copyright__ = "Copyright 2022, NVIDIA; Copyright 2023, Vision Labs LLC"
__credits__ = []
__license__ = "Apache 2.0"
__version__ = "4.1.2-0"
__version__ = "106"
__maintainer__ = "Roman Arzumanyan"
__email__ = "TODO"
__status__ = "Production"
Expand Down
8 changes: 6 additions & 2 deletions src/python_vali/src/PySurfaceDownloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ bool PySurfaceDownloader::Run(Surface& src, py::array& dst,
TaskExecDetails& details) {
auto buffer =
std::shared_ptr<Buffer>(Buffer::Make(dst.nbytes(), dst.mutable_data()));

std::cout << __FILE__ << "::" << __FUNCTION__ << "\n";
std::cout << "array size: " << dst.nbytes() << "\n";
std::cout << "buffer size: " << buffer->GetRawMemSize() << "\n";
std::cout << "surface size: " << src.HostMemSize() << "\n";

upDownloader->SetInput(&src, 0U);
upDownloader->SetInput(buffer.get(), 1U);
Expand Down Expand Up @@ -65,8 +70,7 @@ void Init_PySurfaceDownloader(py::module& m) {
"Run",
[](PySurfaceDownloader& self, Surface& src, py::array& dst) {
TaskExecDetails details;
return std::make_tuple(self.Run(src, dst, details),
details.m_info);
return std::make_tuple(self.Run(src, dst, details), details.m_info);
},
py::arg("src"), py::arg("dst"),
py::call_guard<py::gil_scoped_release>(),
Expand Down

0 comments on commit cd63599

Please sign in to comment.