mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78542 This makes importing easier in different build systems that have different absolute names for the pytorch-root. Differential Revision: [D36782582](https://our.internmc.facebook.com/intern/diff/D36782582/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D36782582/)! Approved by: https://github.com/malfet
26 lines
800 B
Python
26 lines
800 B
Python
load("@bazel_skylib//lib:paths.bzl", "paths")
|
|
load(":build_variables.bzl", "aten_ufunc_headers")
|
|
|
|
aten_ufunc_names = [
|
|
paths.split_extension(paths.basename(h))[0]
|
|
for h in aten_ufunc_headers
|
|
]
|
|
|
|
def aten_ufunc_generated_cpu_sources(gencode_pattern = "{}"):
|
|
return [gencode_pattern.format(name) for name in [
|
|
"UfuncCPU_{}.cpp".format(n)
|
|
for n in aten_ufunc_names
|
|
]]
|
|
|
|
def aten_ufunc_generated_cpu_kernel_sources(gencode_pattern = "{}"):
|
|
return [gencode_pattern.format(name) for name in [
|
|
"UfuncCPUKernel_{}.cpp".format(n)
|
|
for n in aten_ufunc_names
|
|
]]
|
|
|
|
def aten_ufunc_generated_cuda_sources(gencode_pattern = "{}"):
|
|
return [gencode_pattern.format(name) for name in [
|
|
"UfuncCUDA_{}.cu".format(n)
|
|
for n in aten_ufunc_names
|
|
]]
|