mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
[AutoAccept][Codemod][FBSourceBuckFormatLinter] Daily arc lint --take BUCKFORMAT
Reviewed By: zertosh Differential Revision: D33119794 fbshipit-source-id: ca327caf34560c0bba32511e57d5dc18b71bdfe1
This commit is contained in:
parent
59000cff91
commit
7a12b5063e
45
aten.bzl
45
aten.bzl
|
|
@ -1,5 +1,5 @@
|
|||
load("@rules_cc//cc:defs.bzl", "cc_library")
|
||||
load("@bazel_skylib//lib:paths.bzl", "paths")
|
||||
load("@rules_cc//cc:defs.bzl", "cc_library")
|
||||
|
||||
CPU_CAPABILITY_NAMES = ["DEFAULT", "AVX2"]
|
||||
CAPABILITY_COMPILER_FLAGS = {
|
||||
|
|
@ -47,34 +47,37 @@ def intern_build_aten_ops(copts, deps):
|
|||
def generate_aten_impl(ctx):
|
||||
# Declare the entire ATen/ops/ directory as an output
|
||||
ops_dir = ctx.actions.declare_directory("aten/src/ATen/ops")
|
||||
outputs=[ops_dir] + ctx.outputs.outs
|
||||
outputs = [ops_dir] + ctx.outputs.outs
|
||||
|
||||
install_dir = paths.dirname(ops_dir.path)
|
||||
tool_inputs, tool_inputs_manifest = ctx.resolve_tools(tools=[ctx.attr.generator])
|
||||
tool_inputs, tool_inputs_manifest = ctx.resolve_tools(tools = [ctx.attr.generator])
|
||||
ctx.actions.run_shell(
|
||||
outputs=outputs,
|
||||
inputs=ctx.files.srcs,
|
||||
command=ctx.executable.generator.path + " $@",
|
||||
arguments=["--source-path", "aten/src/ATen",
|
||||
"--per-operator-headers",
|
||||
"--install_dir", install_dir],
|
||||
tools=tool_inputs,
|
||||
input_manifests=tool_inputs_manifest,
|
||||
use_default_shell_env=True,
|
||||
outputs = outputs,
|
||||
inputs = ctx.files.srcs,
|
||||
command = ctx.executable.generator.path + " $@",
|
||||
arguments = [
|
||||
"--source-path",
|
||||
"aten/src/ATen",
|
||||
"--per-operator-headers",
|
||||
"--install_dir",
|
||||
install_dir,
|
||||
],
|
||||
tools = tool_inputs,
|
||||
input_manifests = tool_inputs_manifest,
|
||||
use_default_shell_env = True,
|
||||
)
|
||||
return [DefaultInfo(files=depset(outputs))]
|
||||
|
||||
return [DefaultInfo(files = depset(outputs))]
|
||||
|
||||
generate_aten = rule(
|
||||
implementation = generate_aten_impl,
|
||||
attrs = {
|
||||
"outs": attr.output_list(),
|
||||
"srcs": attr.label_list(allow_files=True),
|
||||
"generator": attr.label(
|
||||
executable=True,
|
||||
allow_files=True,
|
||||
mandatory=True,
|
||||
cfg="exec",
|
||||
executable = True,
|
||||
allow_files = True,
|
||||
mandatory = True,
|
||||
cfg = "exec",
|
||||
),
|
||||
}
|
||||
"outs": attr.output_list(),
|
||||
"srcs": attr.label_list(allow_files = True),
|
||||
},
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user