Skip to content

Commit

Permalink
add -l to list out gpu devices
Browse files Browse the repository at this point in the history
  • Loading branch information
TNTwise committed Jan 24, 2024
1 parent eb80824 commit dd679ab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ Usage: rife-ncnn-vulkan -0 infile -1 infile1 -o outfile [options]...
-z enable temporal tta mode
-u enable UHD mode
-f pattern-format output image filename pattern format (%08d.jpg/png/webp, default=ext/%08d.png)
-l list out available gpu devices
```

- `input0-path`, `input1-path` and `output-path` accept file path
Expand Down
11 changes: 10 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ static void print_usage()
fprintf(stdout, " -z enable temporal tta mode\n");
fprintf(stdout, " -u enable UHD mode\n");
fprintf(stderr, " -f pattern-format output image filename pattern format (%%08d.jpg/png/webp, default=ext/%%08d.png)\n");
fprintf(stderr, " -l list out available gpu devices\n");
}

static int decode_image(const path_t& imagepath, ncnn::Mat& image, int* webp)
Expand Down Expand Up @@ -517,7 +518,7 @@ int main(int argc, char** argv)
}
#else // _WIN32
int opt;
while ((opt = getopt(argc, argv, "0:1:i:o:n:s:m:g:j:f:vxzuh")) != -1)
while ((opt = getopt(argc, argv, "0:1:i:o:n:s:m:g:j:f:vxzulh")) != -1)
{
switch (opt)
{
Expand Down Expand Up @@ -564,6 +565,14 @@ int main(int argc, char** argv)
case 'u':
uhd_mode = 1;
break;
case 'l':
{
std::string text;
for (auto i{ 0 }; i < ncnn::get_gpu_count(); i++)
text += std::to_string(i) + ": " + ncnn::get_gpu_info(i).device_name() + "\n";
printf("%p\n");
break;
}
case 'h':
default:
print_usage();
Expand Down

0 comments on commit dd679ab

Please sign in to comment.