From 6f1871777fa781f921fb30fdeff0ccafac7927ca Mon Sep 17 00:00:00 2001 From: Aryan Salmanpour Date: Tue, 24 Sep 2024 19:06:50 -0400 Subject: [PATCH] Modify the videoDecodePerf app to take an argument for memory type (#424) [ROCm/rocdecode commit: 0ba9992247a3beb096513435f8932a625da94d75] --- .../rocdecode/samples/videoDecodePerf/README.md | 5 +++++ .../samples/videoDecodePerf/videodecodeperf.cpp | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/projects/rocdecode/samples/videoDecodePerf/README.md b/projects/rocdecode/samples/videoDecodePerf/README.md index becaf9c486..f908b31973 100644 --- a/projects/rocdecode/samples/videoDecodePerf/README.md +++ b/projects/rocdecode/samples/videoDecodePerf/README.md @@ -35,4 +35,9 @@ make -j -disp_delay -d = 0) [optional - default:0]> -z + -m ``` \ No newline at end of file diff --git a/projects/rocdecode/samples/videoDecodePerf/videodecodeperf.cpp b/projects/rocdecode/samples/videoDecodePerf/videodecodeperf.cpp index 81134628bf..81457f3bdf 100644 --- a/projects/rocdecode/samples/videoDecodePerf/videodecodeperf.cpp +++ b/projects/rocdecode/samples/videoDecodePerf/videodecodeperf.cpp @@ -74,8 +74,13 @@ void ShowHelpAndExit(const char *option = NULL) { std::cout << "Options:" << std::endl << "-i Input File Path - required" << std::endl << "-t Number of threads (>= 1) - optional; default: 1" << std::endl - << "-d Device ID (>= 0) - optional; default: 0" << std::endl - << "-z force_zero_latency (force_zero_latency, Decoded frames will be flushed out for display immediately); optional;" << std::endl; + << "-d Device ID (>= 0) - optional; default: 0" << std::endl + << "-z Force zero latency (decoded frames will be flushed out for display immediately) - optional" << std::endl + << "-m Memory type (integer values between 0 to 3: specifies where to store the decoded output:" << std::endl + << " 0 = decoded output will be in internal interopped memory," << std::endl + << " 1 = decoded output will be copied to a separate device memory," << std::endl + << " 2 = decoded output will be copied to a separate host memory," << std::endl + << " 3 = decoded output will not be available (decode only)) - optional; default: 3" << std::endl; exit(0); } @@ -146,6 +151,13 @@ int main(int argc, char **argv) { b_force_zero_latency = true; continue; } + if (!strcmp(argv[i], "-m")) { + if (++i == argc) { + ShowHelpAndExit("-m"); + } + mem_type = static_cast(atoi(argv[i])); + continue; + } ShowHelpAndExit(argv[i]); }