Skip to content

Commit 7718268

Browse files
authored
feat: add static version cufft (for device callback) (#303)
1 parent 2c59a40 commit 7718268

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

cuda/private/templates/BUILD.cufft

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,50 @@ cc_library(
3434
":cufftw_lib",
3535
]),
3636
)
37+
38+
cc_import(
39+
name = "cufftw_static_a",
40+
static_library = "%{component_name}/%{libpath}/libcufftw_static.a",
41+
target_compatible_with = ["@platforms//os:linux"],
42+
)
43+
44+
cc_import(
45+
name = "cufft_static_a",
46+
static_library = "%{component_name}/%{libpath}/libcufft_static.a",
47+
target_compatible_with = ["@platforms//os:linux"],
48+
)
49+
50+
cc_import(
51+
name = "cufft_static_nocallback_a",
52+
static_library = "%{component_name}/%{libpath}/libcufft_static_nocallback.a",
53+
target_compatible_with = ["@platforms//os:linux"],
54+
)
55+
56+
cc_library(
57+
name = "cufftw_static",
58+
deps = [
59+
":%{component_name}_headers",
60+
] + if_linux([
61+
":cufftw_static_a",
62+
]),
63+
)
64+
65+
cc_library(
66+
name = "cufft_static",
67+
deps = [
68+
":%{component_name}_headers",
69+
] + if_linux([
70+
":cufftw_static_a",
71+
":cufft_static_a",
72+
]),
73+
)
74+
75+
cc_library(
76+
name = "cufft_static_nocallback",
77+
deps = [
78+
":%{component_name}_headers",
79+
] + if_linux([
80+
":cufftw_static_a",
81+
":cufft_static_nocallback_a",
82+
]),
83+
)

cuda/private/templates/registry.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ REGISTRY = {
44
"nvcc": ["compiler_deps", "nvptxcompiler"],
55
"cccl": ["cub", "thrust"],
66
"cublas": ["cublas"],
7-
"cufft": ["cufft"],
7+
"cufft": ["cufft", "cufft_static"],
88
"cufile": [],
99
"cupti": ["cupti", "nvperf_host", "nvperf_target"],
1010
"curand": ["curand"],

0 commit comments

Comments
 (0)