blob: e52ac21de5a473d26b85feb5221b903ad627bd6a [file] [log] [blame]
* Copyright (c) Facebook, Inc. and its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* See the License for the specific language governing permissions and
* limitations under the License.
{namespace buck.halide_library}
{template .soyweb}
{param title: 'halide_library()' /}
{param navid: 'rule_halide_library' /}
{param prettify: true /}
{param description}
A halide_library() rule represents a set of Halide source files.
{param content}
{call buck.rule}
{param status: 'UNFROZEN' /}
{param overview}
A halide_library() rule represents a set of Halide sources, along with the "compiler"
code needed to compile them into object format (see <a href="">
the Halide site</a> for information about Halide and about static compilation of
Halide pipelines). The object code will be generated for the target architecture.
{param args}
{call buck.name_arg /}
{call buck.arg}
{param name: 'srcs' /}
{param desc}
The set of halide sources to compile for this rule. The sources will be
compiled and linked for the host architecture, and the resulting binary will
be run to produce the object code for the Halide pipeline.
{call buck.arg}
{param name: 'deps' /}
{param default: '[]' /}
{param desc}
The dependencies of the generated halide pipeline code. This is useful if, for
exmaple, your pipeline calls an external function using Halide::Func::define_extern.
{call buck.arg}
{param name: 'compiler_deps' /}
{param default: '[]' /}
{param desc}
The dependencies of the halide compiler itself. Targets that depend on the
halide_library rule will not include or link the outputs of these targets.
{call cxx_common.compiler_flags_arg /}
{call cxx_common.platform_compiler_flags_arg /}
{call cxx_common.linker_flags_arg /}
{call cxx_common.platform_linker_flags_arg /}
{call cxx_common.supported_platforms_regex_arg /}
{/param} // close args
{param examples}
{literal}<pre class="prettyprint lang-py">
# Your library name.
name = 'brighter',
# Your pipeline + compiler sources.
srcs = ['halide/main.cpp'],
# Any dependencies for your compiler. Note that targets that depend on
# this rule WILL NOT include or link the output(s) of these targets.
compiler_deps = [
# You'll need libHalide to use this rule; in our example, we assume it's
# located in the 'third-party/halide' directory.
# Any dependencies for your generated shader. Targets that depend on this
# rule will include and/or link the output(s) of these targets.
deps = [
# ...
{/call} // close buck.rule