Files
pytorch/ufunc_defs.bzl
Michael Andreas Dagitses 501d0729cb move build_variables.bzl and ufunc_defs.bzl from pytorch-root/tools/ to the root
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
2022-06-02 19:39:27 +00:00

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
]]