halide 19.0.0__cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. halide/__init__.py +39 -0
  2. halide/_generator_helpers.py +835 -0
  3. halide/bin/adams2019_retrain_cost_model +0 -0
  4. halide/bin/adams2019_weightsdir_to_weightsfile +0 -0
  5. halide/bin/anderson2021_retrain_cost_model +0 -0
  6. halide/bin/anderson2021_weightsdir_to_weightsfile +0 -0
  7. halide/bin/featurization_to_sample +0 -0
  8. halide/bin/gengen +0 -0
  9. halide/bin/get_host_target +0 -0
  10. halide/halide_.cpython-313-x86_64-linux-gnu.so +0 -0
  11. halide/imageio.py +60 -0
  12. halide/include/Halide.h +35293 -0
  13. halide/include/HalideBuffer.h +2618 -0
  14. halide/include/HalidePyTorchCudaHelpers.h +64 -0
  15. halide/include/HalidePyTorchHelpers.h +120 -0
  16. halide/include/HalideRuntime.h +2221 -0
  17. halide/include/HalideRuntimeCuda.h +89 -0
  18. halide/include/HalideRuntimeD3D12Compute.h +91 -0
  19. halide/include/HalideRuntimeHexagonDma.h +104 -0
  20. halide/include/HalideRuntimeHexagonHost.h +157 -0
  21. halide/include/HalideRuntimeMetal.h +112 -0
  22. halide/include/HalideRuntimeOpenCL.h +119 -0
  23. halide/include/HalideRuntimeQurt.h +32 -0
  24. halide/include/HalideRuntimeVulkan.h +137 -0
  25. halide/include/HalideRuntimeWebGPU.h +44 -0
  26. halide/lib64/cmake/Halide/FindHalide_LLVM.cmake +152 -0
  27. halide/lib64/cmake/Halide/FindV8.cmake +33 -0
  28. halide/lib64/cmake/Halide/Halide-shared-deps.cmake +0 -0
  29. halide/lib64/cmake/Halide/Halide-shared-targets-release.cmake +29 -0
  30. halide/lib64/cmake/Halide/Halide-shared-targets.cmake +154 -0
  31. halide/lib64/cmake/Halide/HalideConfig.cmake +162 -0
  32. halide/lib64/cmake/Halide/HalideConfigVersion.cmake +65 -0
  33. halide/lib64/cmake/HalideHelpers/FindHalide_WebGPU.cmake +27 -0
  34. halide/lib64/cmake/HalideHelpers/Halide-Interfaces-release.cmake +116 -0
  35. halide/lib64/cmake/HalideHelpers/Halide-Interfaces.cmake +236 -0
  36. halide/lib64/cmake/HalideHelpers/HalideGeneratorHelpers.cmake +1056 -0
  37. halide/lib64/cmake/HalideHelpers/HalideHelpersConfig.cmake +28 -0
  38. halide/lib64/cmake/HalideHelpers/HalideHelpersConfigVersion.cmake +54 -0
  39. halide/lib64/cmake/HalideHelpers/HalideTargetHelpers.cmake +99 -0
  40. halide/lib64/cmake/HalideHelpers/MutexCopy.ps1 +31 -0
  41. halide/lib64/cmake/HalideHelpers/TargetExportScript.cmake +55 -0
  42. halide/lib64/cmake/Halide_Python/Halide_Python-targets-release.cmake +30 -0
  43. halide/lib64/cmake/Halide_Python/Halide_Python-targets.cmake +125 -0
  44. halide/lib64/cmake/Halide_Python/Halide_PythonConfig.cmake +26 -0
  45. halide/lib64/cmake/Halide_Python/Halide_PythonConfigVersion.cmake +65 -0
  46. halide/lib64/libHalide.so +0 -0
  47. halide/lib64/libHalidePyStubs.a +0 -0
  48. halide/lib64/libHalide_GenGen.a +0 -0
  49. halide/lib64/libautoschedule_adams2019.so +0 -0
  50. halide/lib64/libautoschedule_anderson2021.so +0 -0
  51. halide/lib64/libautoschedule_li2018.so +0 -0
  52. halide/lib64/libautoschedule_mullapudi2016.so +0 -0
  53. halide/share/doc/Halide/LICENSE.txt +233 -0
  54. halide/share/doc/Halide/README.md +439 -0
  55. halide/share/doc/Halide/doc/BuildingHalideWithCMake.md +626 -0
  56. halide/share/doc/Halide/doc/CodeStyleCMake.md +393 -0
  57. halide/share/doc/Halide/doc/FuzzTesting.md +104 -0
  58. halide/share/doc/Halide/doc/HalideCMakePackage.md +812 -0
  59. halide/share/doc/Halide/doc/Hexagon.md +73 -0
  60. halide/share/doc/Halide/doc/Python.md +844 -0
  61. halide/share/doc/Halide/doc/RunGen.md +283 -0
  62. halide/share/doc/Halide/doc/Testing.md +125 -0
  63. halide/share/doc/Halide/doc/Vulkan.md +287 -0
  64. halide/share/doc/Halide/doc/WebAssembly.md +228 -0
  65. halide/share/doc/Halide/doc/WebGPU.md +128 -0
  66. halide/share/tools/RunGen.h +1470 -0
  67. halide/share/tools/RunGenMain.cpp +642 -0
  68. halide/share/tools/adams2019_autotune_loop.sh +227 -0
  69. halide/share/tools/anderson2021_autotune_loop.sh +591 -0
  70. halide/share/tools/halide_benchmark.h +240 -0
  71. halide/share/tools/halide_image.h +31 -0
  72. halide/share/tools/halide_image_info.h +318 -0
  73. halide/share/tools/halide_image_io.h +2794 -0
  74. halide/share/tools/halide_malloc_trace.h +102 -0
  75. halide/share/tools/halide_thread_pool.h +161 -0
  76. halide/share/tools/halide_trace_config.h +559 -0
  77. halide-19.0.0.data/data/share/cmake/Halide/HalideConfig.cmake +6 -0
  78. halide-19.0.0.data/data/share/cmake/Halide/HalideConfigVersion.cmake +65 -0
  79. halide-19.0.0.data/data/share/cmake/HalideHelpers/HalideHelpersConfig.cmake +6 -0
  80. halide-19.0.0.data/data/share/cmake/HalideHelpers/HalideHelpersConfigVersion.cmake +54 -0
  81. halide-19.0.0.dist-info/METADATA +301 -0
  82. halide-19.0.0.dist-info/RECORD +84 -0
  83. halide-19.0.0.dist-info/WHEEL +6 -0
  84. halide-19.0.0.dist-info/licenses/LICENSE.txt +233 -0
@@ -0,0 +1,233 @@
1
+ Copyright (c) 2012-2020 MIT CSAIL, Google, Facebook, Adobe, NVIDIA CORPORATION, and other contributors.
2
+
3
+ Developed by:
4
+
5
+ The Halide team
6
+ http://halide-lang.org
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
9
+ this software and associated documentation files (the "Software"), to deal in
10
+ the Software without restriction, including without limitation the rights to
11
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
12
+ of the Software, and to permit persons to whom the Software is furnished to do
13
+ so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in all
16
+ copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ SOFTWARE.
25
+
26
+ -----
27
+
28
+ apps/bgu is Copyright 2016 Google Inc. and is Licensed under the Apache License,
29
+ Version 2.0 (the "License"); you may not use this file except in compliance
30
+ with the License.
31
+
32
+ Apache License
33
+
34
+ Version 2.0, January 2004
35
+
36
+ http://www.apache.org/licenses/
37
+
38
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
39
+
40
+ 1. Definitions.
41
+
42
+ "License" shall mean the terms and conditions for use, reproduction, and
43
+ distribution as defined by Sections 1 through 9 of this document.
44
+
45
+ "Licensor" shall mean the copyright owner or entity authorized by the
46
+ copyright owner that is granting the License.
47
+
48
+ "Legal Entity" shall mean the union of the acting entity and all other
49
+ entities that control, are controlled by, or are under common control with
50
+ that entity. For the purposes of this definition, "control" means (i) the
51
+ power, direct or indirect, to cause the direction or management of such
52
+ entity, whether by contract or otherwise, or (ii) ownership of fifty percent
53
+ (50%) or more of the outstanding shares, or (iii) beneficial ownership of such
54
+ entity.
55
+
56
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
57
+ permissions granted by this License.
58
+
59
+ "Source" form shall mean the preferred form for making modifications,
60
+ including but not limited to software source code, documentation source, and
61
+ configuration files.
62
+
63
+ "Object" form shall mean any form resulting from mechanical transformation or
64
+ translation of a Source form, including but not limited to compiled object
65
+ code, generated documentation, and conversions to other media types.
66
+
67
+ "Work" shall mean the work of authorship, whether in Source or Object form,
68
+ made available under the License, as indicated by a copyright notice that is
69
+ included in or attached to the work (an example is provided in the Appendix
70
+ below).
71
+
72
+ "Derivative Works" shall mean any work, whether in Source or Object form, that
73
+ is based on (or derived from) the Work and for which the editorial revisions,
74
+ annotations, elaborations, or other modifications represent, as a whole, an
75
+ original work of authorship. For the purposes of this License, Derivative
76
+ Works shall not include works that remain separable from, or merely link (or
77
+ bind by name) to the interfaces of, the Work and Derivative Works thereof.
78
+
79
+ "Contribution" shall mean any work of authorship, including the original
80
+ version of the Work and any modifications or additions to that Work or
81
+ Derivative Works thereof, that is intentionally submitted to Licensor for
82
+ inclusion in the Work by the copyright owner or by an individual or Legal
83
+ Entity authorized to submit on behalf of the copyright owner. For the purposes
84
+ of this definition, "submitted" means any form of electronic, verbal, or
85
+ written communication sent to the Licensor or its representatives, including
86
+ but not limited to communication on electronic mailing lists, source code
87
+ control systems, and issue tracking systems that are managed by, or on behalf
88
+ of, the Licensor for the purpose of discussing and improving the Work, but
89
+ excluding communication that is conspicuously marked or otherwise designated
90
+ in writing by the copyright owner as "Not a Contribution."
91
+
92
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf
93
+ of whom a Contribution has been received by Licensor and subsequently
94
+ incorporated within the Work.
95
+
96
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
97
+
98
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
99
+
100
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
101
+
102
+ (a) You must give any other recipients of the Work or Derivative Works a copy
103
+ of this License; and
104
+
105
+ (b) You must cause any modified files to carry prominent notices stating that
106
+ You changed the files; and
107
+
108
+ (c) You must retain, in the Source form of any Derivative Works that You
109
+ distribute, all copyright, patent, trademark, and attribution notices from the
110
+ Source form of the Work, excluding those notices that do not pertain to any
111
+ part of the Derivative Works; and
112
+
113
+ (d) If the Work includes a "NOTICE" text file as part of its distribution,
114
+ then any Derivative Works that You distribute must include a readable copy of
115
+ the attribution notices contained within such NOTICE file, excluding those
116
+ notices that do not pertain to any part of the Derivative Works, in at least
117
+ one of the following places: within a NOTICE text file distributed as part of
118
+ the Derivative Works; within the Source form or documentation, if provided
119
+ along with the Derivative Works; or, within a display generated by the
120
+ Derivative Works, if and wherever such third-party notices normally appear.
121
+ The contents of the NOTICE file are for informational purposes only and do not
122
+ modify the License. You may add Your own attribution notices within Derivative
123
+ Works that You distribute, alongside or as an addendum to the NOTICE text from
124
+ the Work, provided that such additional attribution notices cannot be
125
+ construed as modifying the License.
126
+
127
+ You may add Your own copyright statement to Your modifications and may provide
128
+ additional or different license terms and conditions for use, reproduction, or
129
+ distribution of Your modifications, or for any such Derivative Works as a
130
+ whole, provided Your use, reproduction, and distribution of the Work otherwise
131
+ complies with the conditions stated in this License.
132
+
133
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
134
+
135
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
136
+
137
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
138
+
139
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
140
+
141
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
142
+
143
+ END OF TERMS AND CONDITIONS
144
+
145
+ -----
146
+
147
+ apps/support/cmdline.h is Copyright (c) 2009, Hideyuki Tanaka and is licensed
148
+ under the BSD 3-Clause license.
149
+
150
+ Redistribution and use in source and binary forms, with or without
151
+ modification, are permitted provided that the following conditions are met:
152
+ * Redistributions of source code must retain the above copyright
153
+ notice, this list of conditions and the following disclaimer.
154
+ * Redistributions in binary form must reproduce the above copyright
155
+ notice, this list of conditions and the following disclaimer in the
156
+ documentation and/or other materials provided with the distribution.
157
+ * Neither the name of the <organization> nor the
158
+ names of its contributors may be used to endorse or promote products
159
+ derived from this software without specific prior written permission.
160
+
161
+ THIS SOFTWARE IS PROVIDED BY <copyright holder> ''AS IS'' AND ANY
162
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
163
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
164
+ DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
165
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
166
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
167
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
168
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
169
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
170
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
171
+
172
+ ----
173
+
174
+ dependencies/spirv is Copyright (c) 2014-2018 The Khronos Group Inc.
175
+
176
+ Permission is hereby granted, free of charge, to any person obtaining a copy
177
+ of this software and/or associated documentation files (the "Materials"),
178
+ to deal in the Materials without restriction, including without limitation
179
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
180
+ and/or sell copies of the Materials, and to permit persons to whom the
181
+ Materials are furnished to do so, subject to the following conditions:
182
+
183
+ The above copyright notice and this permission notice shall be included in
184
+ all copies or substantial portions of the Materials.
185
+
186
+ MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
187
+ STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
188
+ HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
189
+
190
+ THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
191
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
192
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
193
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
194
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
195
+ FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS
196
+ IN THE MATERIALS.
197
+
198
+
199
+ ----
200
+
201
+ dependencies/vulkan is Copyright (c) 2014-2017 The Khronos Group Inc.
202
+
203
+ Licensed under the Apache License, Version 2.0 (the "License");
204
+ you may not use this file except in compliance with the License.
205
+ You may obtain a copy of the License at
206
+
207
+ http://www.apache.org/licenses/LICENSE-2.0
208
+
209
+ Unless required by applicable law or agreed to in writing, software
210
+ distributed under the License is distributed on an "AS IS" BASIS,
211
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
212
+ See the License for the specific language governing permissions and
213
+ limitations under the License.
214
+
215
+ ----
216
+
217
+ apps/linear_algebra/include/cblas.h is licensed under the BLAS license.
218
+
219
+ The reference BLAS is a freely-available software package. It is available from
220
+ netlib via anonymous ftp and the World Wide Web. Thus, it can be included in
221
+ commercial software packages (and has been). We only ask that proper credit be
222
+ given to the authors.
223
+
224
+ Like all software, it is copyrighted. It is not trademarked, but we do ask the
225
+ following:
226
+
227
+ If you modify the source for these routines we ask that you change the name of
228
+ the routine and comment the changes made to the original.
229
+
230
+ We will gladly answer any questions regarding the software. If a modification is
231
+ done, however, it is the responsibility of the person who modified the routine
232
+ to provide support.
233
+
@@ -0,0 +1,439 @@
1
+ # Halide
2
+
3
+ Halide is a programming language designed to make it easier to write
4
+ high-performance image and array processing code on modern machines. Halide
5
+ currently targets:
6
+
7
+ - CPU architectures: X86, ARM, Hexagon, PowerPC, RISC-V
8
+ - Operating systems: Linux, Windows, macOS, Android, iOS, Qualcomm QuRT
9
+ - GPU Compute APIs: CUDA, OpenCL, Apple Metal, Microsoft Direct X 12, Vulkan
10
+
11
+ Rather than being a standalone programming language, Halide is embedded in C++.
12
+ This means you write C++ code that builds an in-memory representation of a
13
+ Halide pipeline using Halide's C++ API. You can then compile this representation
14
+ to an object file, or JIT-compile it and run it in the same process. Halide also
15
+ provides a Python binding that provides full support for writing Halide embedded
16
+ in Python without C++.
17
+
18
+ Halide requires C++17 (or later) to use.
19
+
20
+ For more detail about what Halide is, see https://halide-lang.org.
21
+
22
+ For API documentation see https://halide-lang.org/docs.
23
+
24
+ For some example code, read through the tutorials online
25
+ at https://halide-lang.org/tutorials. The corresponding code is in the
26
+ `tutorials/` directory. Larger examples are in the `apps/` directory.
27
+
28
+ If you've acquired a full source distribution and want to build Halide, see the
29
+ [notes below](#building-halide).
30
+
31
+ # Getting Halide
32
+
33
+ ## Pip
34
+
35
+ As of Halide 19.0.0, we provide binary wheels on PyPI. Halide provides bindings
36
+ for C++ and Python. Even if you only intend to use Halide from C++, pip may be
37
+ the easiest way to get a binary build of Halide.
38
+
39
+ Full releases may be installed with `pip` like so:
40
+
41
+ ```shell
42
+ $ pip install halide
43
+ ```
44
+
45
+ Every commit to `main` is published to Test PyPI as a development version and
46
+ these may be installed with a few extra flags:
47
+
48
+ ```shell
49
+ $ pip install halide --pre --extra-index-url https://test.pypi.org/simple
50
+ ```
51
+
52
+ Currently, we provide wheels for: Windows x86-64, macOS x86-64, macOS arm64, and
53
+ Linux x86-64. The Linux wheels are built for manylinux_2_28, which makes them
54
+ broadly compatible (Debian 10, Ubuntu 18.10, Fedora 29).
55
+
56
+ *For C++ usage of the pip package:* On Linux and macOS, CMake's `find_package`
57
+ command should find Halide as long as you're in the same virtual environment you
58
+ installed it in. On Windows, you will need to add the virtual environment root
59
+ directory to `CMAKE_PREFIX_PATH`. This can be done by running
60
+ `set CMAKE_PREFIX_PATH=%VIRTUAL_ENV%` in `cmd`.
61
+
62
+ Other build systems can find the Halide root path by running `python -c
63
+ "import halide; print(halide.install_dir())"`.
64
+
65
+ ## Homebrew
66
+
67
+ Alternatively, if you use macOS, you can install Halide via
68
+ [Homebrew](https://brew.sh/) like so:
69
+
70
+ ```
71
+ $ brew install halide
72
+ ```
73
+
74
+ ## Binary tarballs
75
+
76
+ The latest version of Halide can always be found on GitHub
77
+ at https://github.com/halide/Halide/releases
78
+
79
+ We provide binary releases for many popular platforms and architectures,
80
+ including 32/64-bit x86 Windows, 64-bit x86/ARM macOS, and 32/64-bit x86/ARM
81
+ Ubuntu Linux.
82
+
83
+ The macOS releases are built using XCode's command-line tools with Apple Clang
84
+ 500.2.76. This means that we link against libc++ instead of libstdc++. You may
85
+ need to adjust compiler options accordingly if you're using an older XCode which
86
+ does not default to libc++.
87
+
88
+ We use a recent Ubuntu LTS to build the Linux releases; if your distribution is
89
+ too old, it might not have the requisite glibc.
90
+
91
+ Nightly builds of Halide and the LLVM versions we use in CI are also available
92
+ at https://buildbot.halide-lang.org/
93
+
94
+ ## Vcpkg
95
+
96
+ If you use [vcpkg](https://github.com/microsoft/vcpkg) to manage dependencies,
97
+ you can install Halide via:
98
+
99
+ ```
100
+ $ vcpkg install halide:x64-windows # or x64-linux/x64-osx
101
+ ```
102
+
103
+ One caveat: vcpkg installs only the minimum Halide backends required to compile
104
+ code for the active platform. If you want to include all the backends, you
105
+ should install `halide[target-all]:x64-windows` instead. Note that since this
106
+ will build LLVM, it will take a _lot_ of disk space (up to 100GB).
107
+
108
+ ## Other package managers
109
+
110
+ We are interested in bringing Halide to other popular package managers and Linux
111
+ distribution repositories! We track the status of various distributions of
112
+ Halide [in this GitHub issue](https://github.com/halide/Halide/issues/4660). If
113
+ you have experience publishing packages we would be happy to work with you!
114
+
115
+ # Building Halide
116
+
117
+ ## Platform Support
118
+
119
+ There are two sets of platform requirements relevant to Halide: those required
120
+ to run the compiler library in either JIT or AOT mode, and those required to run
121
+ the _binary outputs_ of the AOT compiler.
122
+
123
+ These are the **tested** host toolchain and platform combinations for building
124
+ and running the Halide compiler library.
125
+
126
+ | Compiler | Version | OS | Architectures |
127
+ |------------|--------------|------------------------|---------------|
128
+ | GCC | 9.5 | Ubuntu Linux 20.04 LTS | x86, x64 |
129
+ | GCC | 11.4 | Ubuntu Linux 22.04 LTS | ARM32, ARM64 |
130
+ | MSVC | 2022 (19.37) | Windows 11 (22631) | x86, x64 |
131
+ | AppleClang | 15.0.0 | macOS 14.4.1 | x64 |
132
+ | AppleClang | 14.0.0 | macOS 14.6 | ARM64 |
133
+
134
+ Some users have successfully built Halide for Linux using Clang 9.0.0+, for
135
+ Windows using ClangCL 11.0.0+, and for Windows ARM64 by cross-compiling with
136
+ MSVC. We do not actively test these scenarios, however, so your mileage may
137
+ vary.
138
+
139
+ Beyond these, we are willing to support (by accepting PRs for) platform and
140
+ toolchain combinations that still receive _active, first-party, public support_
141
+ from their original vendors. For instance, at time of writing, this excludes
142
+ Windows 7 and includes Ubuntu 18.04 LTS.
143
+
144
+ Compiled AOT pipelines are expected to have much broader platform support. The
145
+ binaries use the C ABI, and we expect any compliant C compiler to be able to use
146
+ the generated headers correctly. The C++ bindings currently require C++17. If
147
+ you discover a compatibility problem with a generated pipeline, please open an
148
+ issue.
149
+
150
+ ## Acquiring LLVM
151
+
152
+ At any point in time, building Halide requires either the latest stable version
153
+ of LLVM, the previous stable version of LLVM, or trunk. At the time of writing,
154
+ this means versions 19, 18, and 17 are supported, but 16 is not.
155
+
156
+ It is simplest to get a binary release of LLVM on macOS by using
157
+ [Homebrew](https://brew.sh). Just run `brew install llvm`. On Debian flavors of
158
+ Linux, the [LLVM APT repo](https://apt.llvm.org) is best; use the provided
159
+ installation script. We know of no suitable official binary releases for
160
+ Windows, however the ones we use in CI can usually be found at
161
+ https://buildbot.halide-lang.org, along with tarballs for our other tested
162
+ platforms. See [the section on Windows](#windows) below for further advice.
163
+
164
+ If your OS does not have packages for LLVM, or you want more control over the
165
+ configuration, you can build it yourself. First check it out from GitHub:
166
+
167
+ ```shell
168
+ $ git clone --depth 1 --branch llvmorg-18.1.8 https://github.com/llvm/llvm-project.git
169
+ ```
170
+
171
+ (LLVM 18.1.8 is the most recent released LLVM at the time of writing. For
172
+ current trunk, use `main` instead)
173
+
174
+ Then build it like so:
175
+
176
+ ```shell
177
+ $ cmake -G Ninja -S llvm-project/llvm -B build \
178
+ -DCMAKE_BUILD_TYPE=Release \
179
+ -DLLVM_ENABLE_PROJECTS="clang;lld;clang-tools-extra" \
180
+ -DLLVM_ENABLE_RUNTIMES=compiler-rt \
181
+ -DLLVM_TARGETS_TO_BUILD="WebAssembly;X86;AArch64;ARM;Hexagon;NVPTX;PowerPC;RISCV" \
182
+ -DLLVM_ENABLE_ASSERTIONS=ON \
183
+ -DLLVM_ENABLE_EH=ON \
184
+ -DLLVM_ENABLE_RTTI=ON \
185
+ -DLLVM_ENABLE_HTTPLIB=OFF \
186
+ -DLLVM_ENABLE_LIBEDIT=OFF \
187
+ -DLLVM_ENABLE_LIBXML2=OFF \
188
+ -DLLVM_ENABLE_TERMINFO=OFF \
189
+ -DLLVM_ENABLE_ZLIB=OFF \
190
+ -DLLVM_ENABLE_ZSTD=OFF \
191
+ -DLLVM_BUILD_32_BITS=OFF
192
+ $ cmake --build build
193
+ $ cmake --install build --prefix llvm-install
194
+ ```
195
+
196
+ This will produce a working LLVM installation in `$PWD/llvm-install`. We refer
197
+ to this path as `LLVM_ROOT` later. **Do not confuse this installation tree with
198
+ the build tree!**
199
+
200
+ LLVM takes a long time to build, so the above command uses Ninja to maximize
201
+ parallelism. If you choose to omit `-G Ninja`, Makefiles will be generated
202
+ instead. In this case, enable parallelism with `cmake --build build -j NNN`
203
+ where `NNN` is the number of parallel jobs, i.e. the number of CPUs you have.
204
+
205
+ Note that you _must_ add `clang` and `lld` to `LLVM_ENABLE_PROJECTS` and
206
+ `WebAssembly` and `X86` _must_ be included in `LLVM_TARGETS_TO_BUILD`.
207
+ `LLVM_ENABLE_RUNTIMES=compiler-rt` is only required to build the fuzz tests, and
208
+ `clang-tools-extra` is only necessary if you plan to contribute code to Halide
209
+ (so that you can run `clang-tidy` on your pull requests). You can disable
210
+ exception handling (EH) and RTTI if you don't want the Python bindings. We
211
+ recommend enabling the full set to simplify builds during development.
212
+
213
+ ## Building Halide with CMake
214
+
215
+ This is discussed in greater detail in [BuildingHalideWithCMake.md]. CMake
216
+ version 3.28+ is required to build Halide.
217
+
218
+ [BuildingHalideWithCMake.md]: doc/BuildingHalideWithCMake.md
219
+
220
+ ### MacOS and Linux
221
+
222
+ Follow the above instructions to build LLVM or acquire a suitable binary
223
+ release. Then change directory to the Halide repository and run:
224
+
225
+ ```shell
226
+ $ cmake -G Ninja -S . -B build -DCMAKE_BUILD_TYPE=Release -DHalide_LLVM_ROOT=$LLVM_ROOT
227
+ $ cmake --build build
228
+ ```
229
+
230
+ Setting `-DHalide_LLVM_ROOT` is not required if you have a suitable system-wide
231
+ version installed. However, if you have multiple LLVMs installed, it can pick
232
+ between them.
233
+
234
+ ### Windows
235
+
236
+ We suggest building with Visual Studio 2022. Your mileage may vary with earlier
237
+ versions. Be sure to install the "C++ CMake tools for Windows" in the Visual
238
+ Studio installer. For older versions of Visual Studio, do not install the CMake
239
+ tools, but instead acquire CMake and Ninja from their respective project
240
+ websites.
241
+
242
+ These instructions start from the `D:` drive. We assume this git repo is cloned
243
+ to `D:\Halide`. We also assume that your shell environment is set up correctly.
244
+ For a 64-bit build, run:
245
+
246
+ ```
247
+ D:\> "C:\Program Files (x86)\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
248
+ ```
249
+
250
+ For a 32-bit build, run:
251
+
252
+ ```
253
+ D:\> "C:\Program Files (x86)\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64_x86
254
+ ```
255
+
256
+ #### Managing dependencies with vcpkg
257
+
258
+ The best way to get compatible dependencies on Windows is to use
259
+ [vcpkg](https://github.com/Microsoft/vcpkg). Install it like so:
260
+
261
+ ```
262
+ D:\> git clone https://github.com/Microsoft/vcpkg.git
263
+ D:\> cd vcpkg
264
+ D:\vcpkg> .\bootstrap-vcpkg.bat -disableMetrics
265
+ ...
266
+ CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=D:/vcpkg/scripts/buildsystems/vcpkg.cmake"
267
+ ```
268
+
269
+ When using the toolchain file, vcpkg will automatically build all the necessary
270
+ dependencies. However, as stated above, be aware that acquiring LLVM this way
271
+ may use over 100 GB of disk space for its build trees and take a very long time
272
+ to build. You can manually delete the build trees afterward, but vcpkg will not
273
+ do this automatically.
274
+
275
+ See [BuildingHalideWithCMake.md](./doc/BuildingHalideWithCMake.md#vcpkg-presets)
276
+ for directions to use Vcpkg for everything _except_ LLVM.
277
+
278
+ #### Building Halide
279
+
280
+ Create a separate build tree and call CMake with vcpkg's toolchain. This will
281
+ build in either 32-bit or 64-bit depending on the environment script (`vcvars`)
282
+ that was run earlier.
283
+
284
+ ```
285
+ D:\Halide> cmake -G Ninja -S . -B build ^
286
+ --toolchain D:/vcpkg/scripts/buildsystems/vcpkg.cmake ^
287
+ -DCMAKE_BUILD_TYPE=Release
288
+ ```
289
+
290
+ Then run the build with:
291
+
292
+ ```
293
+ D:\Halide> cmake --build build
294
+ ```
295
+
296
+ To run all the tests:
297
+
298
+ ```
299
+ D:\Halide> ctest --test-dir build --output-on-failure
300
+ ```
301
+
302
+ Subsets of the tests can be selected with `-L` and include `correctness`,
303
+ `generator`, `error`, and the other directory names under `tests/`.
304
+
305
+ #### Building LLVM (optional)
306
+
307
+ Follow these steps if you want to build LLVM yourself. First, download LLVM's
308
+ sources (these instructions use the 18.1.8 release).
309
+
310
+ ```
311
+ D:\> git clone --depth 1 --branch llvm-org-18.1.8 https://github.com/llvm/llvm-project.git
312
+ ```
313
+
314
+ As above, run `vcvarsall.bat` to pick between x86 and x64. Then configure LLVM
315
+ with the following command (for 32-bit, set `-DLLVM_BUILD_32_BITS=ON` instead):
316
+
317
+ ```
318
+ D:\> cmake -G Ninja -S llvm-project\llvm -B build ^
319
+ -DCMAKE_BUILD_TYPE=Release ^
320
+ -DLLVM_ENABLE_PROJECTS=clang;lld;clang-tools-extra ^
321
+ -DLLVM_ENABLE_RUNTIMES=compiler-rt ^
322
+ -DLLVM_TARGETS_TO_BUILD=WebAssembly;X86;AArch64;ARM;Hexagon;NVPTX;PowerPC;RISCV ^
323
+ -DLLVM_ENABLE_ASSERTIONS=ON ^
324
+ -DLLVM_ENABLE_EH=ON ^
325
+ -DLLVM_ENABLE_RTTI=ON ^
326
+ -DLLVM_ENABLE_HTTPLIB=OFF ^
327
+ -DLLVM_ENABLE_LIBEDIT=OFF ^
328
+ -DLLVM_ENABLE_LIBXML2=OFF ^
329
+ -DLLVM_ENABLE_TERMINFO=OFF ^
330
+ -DLLVM_ENABLE_ZLIB=OFF ^
331
+ -DLLVM_ENABLE_ZSTD=OFF ^
332
+ -DLLVM_BUILD_32_BITS=OFF
333
+ ```
334
+
335
+ **MSBuild:** If you want to build LLVM with MSBuild instead of Ninja, use
336
+ `-G "Visual Studio 17 2022" -Thost=x64 -A x64` or
337
+ `-G "Visual Studio 17 2022" -Thost=x64 -A Win32` in place of `-G Ninja`.
338
+
339
+ Finally, run the build and install to a local directory:
340
+
341
+ ```
342
+ D:\> cmake --build build --config Release
343
+ D:\> cmake --install build --prefix llvm-install
344
+ ```
345
+
346
+ You can substitute `Debug` for `Release` in the above `cmake` commands if you
347
+ want a debug build.
348
+
349
+ To use this with Halide, but still allow vcpkg to manage other dependencies, you
350
+ must add two flags to Halide's CMake configure command line. First, disable LLVM
351
+ with `-DVCPKG_OVERLAY_PORTS=cmake/vcpkg`. Second, point CMake to our newly built
352
+ Halide with `-DHalide_LLVM_ROOT=D:/llvm-install`.
353
+
354
+ #### If all else fails...
355
+
356
+ Do what the buildbots do: https://buildbot.halide-lang.org/master/#/builders
357
+
358
+ If the row that best matches your system is red, then maybe things aren't just
359
+ broken for you. If it's green, then you can click through to the latest build
360
+ and see the commands that the build bots run. Open a step ("Configure Halide" is
361
+ useful) and look at the "stdio" logs in the viewer. These logs contain the full
362
+ commands that were run, as well as the environment variables they were run with.
363
+
364
+ ## Building Halide with make
365
+
366
+ > [!WARNING]
367
+ > We do not provide support for the Makefile. Feel free to use it, but if
368
+ > anything goes wrong, switch to the CMake build. Note also that the Makefile
369
+ > cannot build the Python bindings or produce install packages.
370
+
371
+ *TL;DR*: Have LLVM 17 (or greater) installed and run `make` in the root
372
+ directory of the repository (where this README is).
373
+
374
+ By default, `make` will use the `llvm-config` tool found in the `PATH`. If you
375
+ want to use a different LLVM, such as a custom-built one following the
376
+ instructions above, set the following environment variable:
377
+
378
+ ```shell
379
+ $ export LLVM_CONFIG="$LLVM_ROOT/bin/llvm-config"
380
+ ```
381
+
382
+ Now you should be able to just run `make` in the root directory of the Halide
383
+ source tree. `make run_tests` will run the JIT test suite, and `make test_apps`
384
+ will make sure all the apps compile and run (but won't check their output).
385
+
386
+ When building the tests, you can set the AOT compilation target with the
387
+ `HL_TARGET` environment variable.
388
+
389
+ ### Building Halide out-of-tree with make
390
+
391
+ If you wish to build Halide in a separate directory, you can do that like so:
392
+
393
+ ```shell
394
+ $ cd ..
395
+ $ mkdir halide_build
396
+ $ cd halide_build
397
+ $ make -f ../Halide/Makefile
398
+ ```
399
+
400
+ # Some useful environment variables
401
+
402
+ `HL_JIT_TARGET=...` will set Halide's JIT compilation target.
403
+
404
+ `HL_DEBUG_CODEGEN=1` will print out pseudocode for what Halide is compiling.
405
+ Higher numbers will print more detail.
406
+
407
+ `HL_NUM_THREADS=...` specifies the number of threads to create for the thread
408
+ pool. When the async scheduling directive is used, more threads than this number
409
+ may be required and thus allocated. A maximum of 256 threads is allowed. (By
410
+ default, the number of cores on the host is used.)
411
+
412
+ `HL_TRACE_FILE=...` specifies a binary target file to dump tracing data into
413
+ (ignored unless at least one `trace_` feature is enabled in the target). The
414
+ output can be parsed programmatically by starting from the code in
415
+ `utils/HalideTraceViz.cpp`.
416
+
417
+ # Further references
418
+
419
+ We have more documentation in `doc/`, the following links might be helpful:
420
+
421
+ | Document | Description |
422
+ |-----------------------------------------------|---------------------------------------------------------------------------|
423
+ | [CMake build](doc/BuildingHalideWithCMake.md) | How to configure and build Halide using CMake. |
424
+ | [CMake package](doc/HalideCMakePackage.md) | How to use the Halide CMake package to build your code. |
425
+ | [Hexagon](doc/Hexagon.md) | How to use the Hexagon backend. |
426
+ | [Python](doc/Python.md) | Documentation for the Python bindings. |
427
+ | [RunGen](doc/RunGen.md) | How to use the RunGen interface to run and benchmark arbitrary pipelines. |
428
+ | [Vulkan](doc/Vulkan.md) | How to use the Halide Vulkan backend (BETA) |
429
+ | [WebAssembly](doc/WebAssembly.md) | How to use the WebAssembly backend and how to use V8 in place of wabt. |
430
+ | [WebGPU](doc/WebGPU.md) | How to run WebGPU pipelines (BETA) |
431
+
432
+ The following links are of greater interest to developers wishing to contribute
433
+ code to Halide:
434
+
435
+ | Document | Description |
436
+ |------------------------------------------|---------------------------------------------------------------------------------------------------------------|
437
+ | [CMake developer](doc/CodeStyleCMake.md) | Guidelines for authoring new CMake code. |
438
+ | [FuzzTesting](doc/FuzzTesting.md) | Information about fuzz testing the Halide compiler (rather than pipelines). Intended for internal developers. |
439
+ | [Testing](doc/Testing.md) | Information about our test organization and debugging tips. Intended for internal developers. |