Skip to content

Commit

Permalink
Update if nvjpeg not found
Browse files Browse the repository at this point in the history
  • Loading branch information
deekay42 committed Jun 5, 2024
1 parent 62e072a commit b3d06cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 1 addition & 4 deletions benchmarks/encoding.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import os
import platform
import statistics
import tarfile
import tempfile
import urllib.request

import torch
import torch.utils.benchmark as benchmark
Expand Down Expand Up @@ -52,7 +49,7 @@ def run_benchmark(batch):
stmt=stmt,
setup="import torchvision",
globals={"batch_input": batch_input},
label=f"Image Encoding",
label="Image Encoding",
sub_label=f"{device.upper()} ({strat}): {stmt}",
description=f"{size} images",
num_threads=num_threads,
Expand Down
6 changes: 5 additions & 1 deletion torchvision/csrc/io/image/cuda/encode_jpegs_cuda.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
#include "encode_jpegs_cuda.h"
#if !NVJPEG_FOUND
namespace vision {
namespace image {
std::vector<torch::Tensor> encode_jpegs_cuda(
const std::vector<torch::Tensor>& images,
const std::vector<torch::Tensor>& decoded_images,
const int64_t quality) {
TORCH_CHECK(
false, "encode_jpegs_cuda: torchvision not compiled with nvJPEG support");
}
} // namespace image
} // namespace vision
#else

#include <ATen/ATen.h>
Expand Down

0 comments on commit b3d06cb

Please sign in to comment.