Skip to content

Commit

Permalink
feat: add nvjpeg (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudhan authored Dec 30, 2024
1 parent aeb7bcd commit 2c59a40
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
37 changes: 37 additions & 0 deletions cuda/private/templates/BUILD.nvjpeg
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
cc_import_versioned_sos(
name = "nvjpeg_so",
shared_library = "%{component_name}/%{libpath}/libnvjpeg.so",
)

cc_import(
name = "nvjpeg_lib",
interface_library = "%{component_name}/%{libpath}/x64/nvjpeg.lib",
system_provided = 1,
target_compatible_with = ["@platforms//os:windows"],
)

cc_library(
name = "nvjpeg",
deps = [
":%{component_name}_headers",
] + if_linux([
":nvjpeg_so",
]) + if_windows([
":nvjpeg_lib",
]),
)

cc_import(
name = "nvjpeg_static_a",
static_library = "%{component_name}/%{libpath}/libnvjpeg_static.a",
target_compatible_with = ["@platforms//os:linux"],
)

cc_library(
name = "nvjpeg_static",
deps = [
":%{component_name}_headers",
] + if_linux([
":nvjpeg_static_a",
]),
)
2 changes: 1 addition & 1 deletion cuda/private/templates/registry.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ REGISTRY = {
"npp": ["nppc", "nppial", "nppicc", "nppidei", "nppif", "nppig", "nppim", "nppist", "nppisu", "nppitc", "npps"],
"nvidia_fs": [],
"nvjitlink": ["nvjitlink", "nvjitlink_static"],
"nvjpeg": [],
"nvjpeg": ["nvjpeg", "nvjpeg_static"],
"nvml": ["nvml"],
"nvprof": [],
"nvrtc": ["nvrtc"],
Expand Down

0 comments on commit 2c59a40

Please sign in to comment.