4c63f1b | Steven Johnson | 06 April 2023, 23:34:59 UTC | Revise autoscheduler tool names to match those from #7483 (#7484) The Halide 15.0.0 release inadvertently omitted all of these tools from the packaging. They are being re-added for 15.0.1. While we're doing this, let's go ahead and have the names match those proposed for Halide 16. | 06 April 2023, 23:34:59 UTC |
3172169 | Steven Johnson | 06 April 2023, 19:29:22 UTC | Backport #7479 to release/15.x (#7481) Turn on WITH_UTILS in CMakePresets.json for 'package' preset (Fixes #7465) (#7479) | 06 April 2023, 19:29:22 UTC |
4421ef5 | Steven Johnson | 06 April 2023, 17:41:46 UTC | Bump version to 15.0.1 (#7480) | 06 April 2023, 17:41:46 UTC |
0ba4f57 | Steven Johnson | 05 April 2023, 23:31:48 UTC | Backport #7472 to release/15.x (#7473) Port #6869 to PyCallable (Fix #7213) (#7472) Same issue was present in the JIT wrappers for Python; this is the same fix, adapted for JIT. | 05 April 2023, 23:31:48 UTC |
d7651f4 | Steven Johnson | 01 March 2023, 00:29:17 UTC | Backport #7315 and #7380 to release/15.x branch (#7383) * Make Callable::call_argv_fast public (#7315) * Make Callable::call_argv_fast public * Add rough specification of the calling convention * Fix a typo * Add Callable default ctor + `defined()` method (#7380) * Add Callable default ctor + `defined()` method This allows it to behave like * Add user_assert + test --------- Co-authored-by: Tom Westerhout <14264576+twesterhout@users.noreply.github.com> | 01 March 2023, 00:29:17 UTC |
4ce5009 | Steven Johnson | 16 February 2023, 01:08:47 UTC | Update CMakePresets.json to use VS2022 instead of VS2019 (#7358) | 16 February 2023, 01:08:47 UTC |
034aafa | Steven Johnson | 15 February 2023, 20:57:46 UTC | (Backport #7352 to release/15.x) Fix Python error handling (#7353) Fix Python error handling (#7352) * Fix Python error handling Error handling in the Python bindings wasn't quite right for JIT: We previously replaced halide_error() to throw a C++ exception. Sounds good, but unfortunately, doesn't work reliably: if called from jitted code (which doesn't know about C++ exceptions), the throw statement may be unable to find the enclosing try block (which is outside jitted code), meaning it will call std::terminate. Now, instead, we just leave the JIT error handler unset, and call with an explicit JITUserContext with a custom print handler; in theory, this meant that the code in JITFuncCallContext::finalize() would check for an error after the call into jitted code, and call `halide_runtime_error` if so (which would then trigger an all-in-C++-exception). Unfortunately... (2) JITFuncCallContext is broken by design; it mutates the input JITUserContext, so that trying to use the same JITUserContext for two calls in a row leaves you with a JITUserContext with (at least) the error_handler set. Since at least one of the realize() calls does this twice (once for bounds query, once for execution), this means that an error in the second call would never be seen, since finalize() only reported errors if there wasn't a custom error handler on input. Per @abadams suggestion, we work around this by treating 'JITErrorBuffer::handler' as 'no custom error handler', which is mostly true. (But really, JITFuncCallContext and JITUserContext are a hard-to-reason-about mess and arguably need to rethought entirely.) (3) Removed entirely-unnecessary overrides of runtime print and error handlers from PyStubImpl; despite the comments, this code is unnecessary. * format | 15 February 2023, 20:57:46 UTC |
4543ef7 | Steven Johnson | 14 February 2023, 23:22:02 UTC | (Backport #7347 to release/15.x) Change early-bound default args in Python bindings to late-bound (#7348) Change early-bound default args in Python bindings to late-bound In PyBind11, if you specify a default argument for a method, it is evaluated when the Python module is initialized, *not* when the method is called (as you might expect in C++). For defaults that are just constants/literals, this is no big deal, but when calling get_*_target_from_environment, this means it is called at module init time -- also normally not a big deal (since the values ~never change at runtime anyway), with one big exception (no pun intended): if the function throws an exception (e.g. via calling user_assert() or similar), that exception is thrown at Module-initialization time, which is a much more inscrutable crash, and one that is very hard to recover from. This may seem unlikely, but can happen pretty easily if you set (say) HL_JIT_TARGET=host-cuda (or other gpu) and the given GPU runtime isn't present on the given system; the current behavior is basically "make if impossible for the libHalidePython bindings to run", whereas what we want is "runtime exception thrown when you call the method". This changes the relevant methods to use `Target()` as the default value, and inside the method wrapper, if the value passed equals `Target()`, it replaces the value with the righ `get_*_target_from_environment()` call. (This turned up while doing some testing of https://github.com/halide/Halide/pull/6924 on a system without Vulkan available) | 14 February 2023, 23:22:02 UTC |
193bc29 | Steven Johnson | 29 November 2022, 18:06:01 UTC | BACKPORT: README_python.md should be installed with other READMEs (#7177) (#7178) README_python.md should be installed with other READMEs (#7177) | 29 November 2022, 18:06:01 UTC |
b081233 | Steven Johnson | 02 November 2022, 03:38:11 UTC | Backport #7141m #7144 to 15.x (#7145) * Upgrade some Actions in pip.yml (#7141) Needed to avoid deprecation warnings * Fix Python wheel-building (#7144) Various bits of code rearrangement had invalidated some of the build scripts for Python wheels for our bindings; this fixes that, and also subtracts some other irrelevant stuff that was getting included (e.g. the stub directory). Also updated the "long description" to use README_python.md rather than README.md. | 02 November 2022, 03:38:11 UTC |
18d4f0c | Steven Johnson | 01 November 2022, 22:17:56 UTC | Backport #7140 to 15.x (#7143) Move Python apps to toplevel of python_bindings (#7140) | 01 November 2022, 22:17:56 UTC |
59cccf4 | Steven Johnson | 01 November 2022, 16:52:12 UTC | Backport some PRs to release/15.x (#7138) * Rewrite python_bindings/apps (#7133) * Apply 'Black' formatter to py/test/correctness and py/test/generators (#7135) * halide.imageio needs to support arbitrary bufferviews (#7137) * GitHub Workflows security hardening (#7136) * Give pip.yml permission to read packages (#7139) | 01 November 2022, 16:52:12 UTC |
23af11d | Steven Johnson | 28 October 2022, 16:04:17 UTC | Backport some PRs to release/15.x (#7132) * Require Python 3.8+ in CMake build (#7117) * Add range-checking to Buffer objects in Python (#7128) * Fix Python buffer handling (#7125) * add 'reverse_axes' options to Buffer conversions (#7127) | 28 October 2022, 16:04:17 UTC |
efb46cd | Steven Johnson | 24 October 2022, 22:54:47 UTC | Backport some PRs from main to release/15.x (#7115) * Generate dot() in the Metal backend (#7085) * dot() support for Metal backend) * Restrict dot() to floats * Fix subtle CMake Install bugs (#7103) * Update CMakeLists.txt * Update CMakeLists.txt * Fix some dead links to the 'master' branch (#7107) * Attempt to fix pip build issues (#7098) * Add evaluate() and evaluate_may_gpu() to Python bindings (#7108) * Add evaluate() and evaluate_may_gpu() to Python bindings * pacify clang-tidy Co-authored-by: Volodymyr Kysenko <vksnk@google.com> Co-authored-by: Andrew Adams <andrew.b.adams@gmail.com> | 24 October 2022, 22:54:47 UTC |
e7dfaac | Steven Johnson | 17 October 2022, 18:43:14 UTC | Update README.md (#7091) (#7092) | 17 October 2022, 18:43:14 UTC |
eb2e336 | Steven Johnson | 17 October 2022, 17:11:05 UTC | Fix #7076, #7077 (#7080) * Fix issue 7076 * fixes * Fixes * Update ScheduleFunctions.cpp * Update ScheduleFunctions.cpp * Update ScheduleFunctions.cpp | 17 October 2022, 17:11:05 UTC |
8e2cbe0 | Alexander Root | 14 October 2022, 18:40:17 UTC | [HVX] Fix DistributeShiftsAsMuls (#7083) Fix DistributeShiftsAsMuls | 14 October 2022, 18:40:17 UTC |
23e22cc | Alex Reinking | 13 October 2022, 02:04:56 UTC | Add pip packaging workflow to GHA (#6938) * Add pip packaging workflow * Try adding steps for Windows/macOS * Add CMake/Ninja to runners. * Use MSVC on Windows * Try caching LLVM build * Split LLVM build into separate job * Fix CI * Fix CI * Debugging * Fix path? * Tar for faster transfer and correct perms * Don't build Halide as Universal 2 * Try using ClangCL on Windows * hack in support for universal2 builds * go back to universal2 * add universal2 to CIBW_ARCHS_MACOS * Update workflow to publish to PyPI * Add package metadata * Last fixup before merge | 13 October 2022, 02:04:56 UTC |
e85b880 | Steven Johnson | 06 October 2022, 21:20:44 UTC | pacify clang-tidy by removing unused "using" (#7071) | 06 October 2022, 21:20:44 UTC |
7442ee6 | Steven Johnson | 06 October 2022, 18:12:37 UTC | Autoscheduler test reorg, part 3 (#7067) * Autoscheduler test reorg, part 3 | 06 October 2022, 18:12:37 UTC |
7086c6f | Steven Johnson | 06 October 2022, 18:11:25 UTC | Autoscheduler test reorg, part 2 (#7065) * Autoscheduler test reorg, part 2 Move the Li2018 tests to tests/autoschedulers. Drive-by fix to the Python test. | 06 October 2022, 18:11:25 UTC |
9de4906 | Steven Johnson | 06 October 2022, 18:09:38 UTC | Autoscheduler test reorg, part 1 (#7064) * Autoscheduler test reorg, part 1 The end goal here is to move the tests for all autoschedulers into `test/autoschedulers/<name>`. This part handles the tests for the Mullapudi2016 autoscheduler: - Moves from test/auto_schedule - Silences a lot of the irrelevant noise that the tests emit to stdout (see also #7063) - Ensure that the tests that run manual-and-auto tests actually check the times for plausibility (where "plausible" means "no worse than the current status quo") | 06 October 2022, 18:09:38 UTC |
f360427 | Steven Johnson | 06 October 2022, 17:21:28 UTC | Improve MSAN under JIT (#7059) Running JIT code under MSAN is (still) not officially supported, as it can (and does) give false positives; that said, this PR reduces the false positives in some cases. Specifically: (1) if we are building a JIT shared runtime (ie, we are jitting), and we are compiling with MSAN enabled (detected via preprocessor), we should always use the real MSAN stubs, even if the Target::MSan feature has been cleared (because JITModule::make_module() clears it). (2) Target::get_jit_from_environment() should add any detected sanitizer bits to the target sniffed from HL_JIT_TARGET | 06 October 2022, 17:21:28 UTC |
e3bbafd | Steven Johnson | 06 October 2022, 17:19:23 UTC | Add a terminate_handler to try to report unhandled exceptions (#7038) * Add a terminate_handler to try to report unhandled exceptions * Move terminate handler to an object file, applied to tests * Update terminate_handler.cpp * Update terminate_handler.cpp * Update HalideTestHelpers.cmake | 06 October 2022, 17:19:23 UTC |
16243da | Steve Suzuki | 04 October 2022, 21:25:16 UTC | Add support for float16 buffer in python extension (#7060) | 04 October 2022, 21:25:16 UTC |
5822458 | Steven Johnson | 04 October 2022, 20:24:49 UTC | Upgrade wabt to 1.0.30 (#7058) | 04 October 2022, 20:24:49 UTC |
236521b | Steven Johnson | 28 September 2022, 16:57:49 UTC | Allow redefinition of Generators when in interactive mode (#7053) It's really annoying to be using (e.g.) Colab/Jupyter/etc and get errors about "Generator already defined", so sniff for interactive mode and allow re-registration of the same name in that case. | 28 September 2022, 16:57:49 UTC |
820ec1f | Steven Johnson | 27 September 2022, 16:34:12 UTC | Don't mutate GeneratorParams in PythonGenerators (#7052) * Don't mutate GeneratorParams in PythonGenerators They are really only ever defined at the class level, so if you mutate the value, you are mutating the default value for all future instances. Subtle bug. * Update _generator_helpers.py * Update _generator_helpers.py | 27 September 2022, 16:34:12 UTC |
d5a8118 | Andrew Adams | 26 September 2022, 21:47:13 UTC | Make Halide::round behave as documented (#7012) * Clean up some pointless code * Improve comment on Halide::round * Make Halide::round round to even as documented * Explicitly set the rounding mode in the C backend * Use rint on ptx, which is documented to round to even * round to even on win32 * the nvidia libdevice is buggy for doubles See https://reviews.llvm.org/D85236 * Add missing include to C output * Fix rounding in opencl * Don't test opencl with doubles if CLDoubles is not enabled * Work around hexagon issue * Don't try to emit roundeven on wasm * wasm doesn't support float16 * Add vectorizable lowering for round on platforms without roundeven * Use rint on metal for Halide::round * Make round an intrinsic * Constant-fold round in simplifier * d3d12 fix * Bounds of Call::round * Teach the mullapudi cost model about round * Handle PureIntrinsics of const args in bounds * scatter, undef, and require aren't pure * metal doesn't support doubles * More parens * Add missing return * Add vector versions of rint for wasm * Use nearbyint for wasm instead of rint * revert change to mangling * d3d12 doesn't like double input/output buffers * Lower round on arm-32 not-linux * Don't simplify lowering of round-to-nearest-ties-to-even in codegen * Fix infinite loop in round lowering on arm-32-notlinux * Take care to never revisit args in bounds call visitor * Remove defunct comment Co-authored-by: Steven Johnson <srj@google.com> | 26 September 2022, 21:47:13 UTC |
59353ab | Zalman Stern | 26 September 2022, 19:37:26 UTC | Allow CodeGen_LLVM::codegen_buffer_pointer to support vectors. (#7049) This is useful for scatter/gather in the vector predication intrinsics work. | 26 September 2022, 19:37:26 UTC |
a817414 | Zalman Stern | 24 September 2022, 00:16:33 UTC | Allow call_intrin to call an LLVM intrinsic with void return type. (#7048) Have ```CodeGen_LLVM::get_vector_type``` return the void type if passed the void type as a scalar base. This makes it possible to call intrinsics returning void via ```CodeGenn_LLVM::call_intrin```. Should be very safe as currently this anything doing this would fail inside the routine. The change breaks the invariant that any thing returned from get_vector_type is a vector type, but propagating void for function return types is a pretty standard behavior and if this was not intended, it will very likely fail just outside this instead of having failed inside the use. I.e. very low chance of spurious errors from this. | 24 September 2022, 00:16:33 UTC |
6499ad1 | Zalman Stern | 23 September 2022, 22:58:27 UTC | Fix false positive use after free warning. (#7046) Latest clang is giving a use after free warning for printing a pointer value after it is freed. The compiler is not exactly wrong in that a pointer is being passed to something after it is freed, but the something is just printing the pointer's value for debugging purposes. Cast through an intptr_t to avoid the warning. | 23 September 2022, 22:58:27 UTC |
666b87d | Steven Johnson | 23 September 2022, 18:15:13 UTC | add_requirement() maintenance (#7045) * add_requirement() maintenance This PR started out as a quick fix to add Python bindings for the `add_requirements` methods on Pipeline and Generator (which were missing), but expanded a bit to fix other issues as well: - The implementation of `Generator::add_requirement` was subtly wrong, in that it only worked if you called the method after everything else in your `generate()` method. Now we accumulate requirements and insert them at the end, so you can call the method anywhere. - We had C++ methods that took both an explicit `vector<Expr>` and also a variadic-template version, but the former required a mutable vector... and fixing this to not require that ended up creating ambiguity about which overloaded call to use. Added an ugly enable_if thing to resolve this. (Side note #1: overloading methods to have both templated and non-templated versions with the same name is probably something to avoid in the future.) (Side note #2: we should probably thing more carefully about using variadic templates in our public API in the future; we currently use it pretty heavily, but it tends to be messy and hard to reason about IMHO.) * tidy * remove underscores | 23 September 2022, 18:15:13 UTC |
7286ec3 | Steven Johnson | 22 September 2022, 17:07:32 UTC | Fix PyExt error handling (#7042) The current PythonExtensionGen code attempts to provide verbose error (exception) messages by overriding halide_error and saving the message in a thread_local. This isn't safe or correct, however, and (in general) is wrong for any Halide code using multiple threads. #6994 proposes ways to mitigate this (and there are experiments in place to implement it), but unless/until those enhancements land, we can't leave the code in its current state. So: - Don't try to save the text at all. - Optionally log the text to stderr. - Just throw an exception with the numeric error code. This is suboptimal, but better than the existing usually-incorrect-message behavior. - Bonus: wrap both the error and print overloads with `PyGILState_Ensure()`, as we are supposed to, to ensure we don't die. | 22 September 2022, 17:07:32 UTC |
b4b27b2 | Steven Johnson | 21 September 2022, 23:20:06 UTC | Revert "Temporarily disable testing for apps/fft (#7033)" (#7040) Revert "Temporarily disable testing for apps/fft (#7033) (#7035)" This reverts commit 48d56d8066f322e016d60d486613837e3670dd00. | 21 September 2022, 23:20:06 UTC |
33f6a0f | Volodymyr Kysenko | 21 September 2022, 22:01:10 UTC | Handle widen_right_* intrinsics in bounds inference (#7039) | 21 September 2022, 22:01:10 UTC |
7ec2a4e | Steven Johnson | 21 September 2022, 17:20:03 UTC | Add stack-size-canary test to apps/fft's CMake file (#7034) * Add stack-size-canary test to apps/fft's CMake file This was apparently meant as a canary for stack size usage, but the necessary setting only happened in the Makefile, not the CMake file. Also, drive-by fix in Makefile to ignore warnings about `-ObjC++` being ignored, which apparently can be the case with current AppleClang configs. * Update CMakeLists.txt | 21 September 2022, 17:20:03 UTC |
0d02a0b | Steven Johnson | 21 September 2022, 00:55:56 UTC | Fix Wasm BulkMemory Codgen + Minor fixes to apps/HelloWasm (#7026) * Minor fixes to apps/HelloWasm * trigger buildbots * Fix Codegen * Update CMakeLists.txt | 21 September 2022, 00:55:56 UTC |
7351070 | Steven Johnson | 20 September 2022, 22:52:26 UTC | Codegen_C for user_context (#7031) Codegen_C fixes | 20 September 2022, 22:52:26 UTC |
ba53b93 | Alexander Root | 20 September 2022, 22:00:14 UTC | Add reinterpret simplifications (#7029) Co-authored-by: Steven Johnson <srj@google.com> | 20 September 2022, 22:00:14 UTC |
48d56d8 | Steven Johnson | 20 September 2022, 19:08:29 UTC | Temporarily disable testing for apps/fft (#7033) (#7035) Want to avoid reporting this known bug while fix is investigated | 20 September 2022, 19:08:29 UTC |
36d601f | Steven Johnson | 19 September 2022, 23:18:19 UTC | Don't use `-g` for EMCC (#7025) * Don't use `-g` for EMCC Combining `-g` with other default EMCC flags will now emit warning/error messages regarding binaryen optimization, so, don't use that flag in the default settings. * Update Error.cpp | 19 September 2022, 23:18:19 UTC |
3a5941d | Steven Johnson | 16 September 2022, 23:38:19 UTC | Appease Python linter (#7022) Apparently it's "more Pythonic" to use "not in" vs "not ... in", etc. | 16 September 2022, 23:38:19 UTC |
ef10a42 | Steven Johnson | 16 September 2022, 21:06:17 UTC | Define a Generator framework in Python (#6764) * Define a Generator framework in Python | 16 September 2022, 21:06:17 UTC |
5ff15bb | Alexander Root | 15 September 2022, 01:54:29 UTC | Fix SpecificExpr canonicalization (#7016) fix SpecificExpr canonicalization | 15 September 2022, 01:54:29 UTC |
18b06f0 | Steven Johnson | 14 September 2022, 20:49:20 UTC | Revert "[HVX] Simplify constant factor before distributing" (#7013) Revert "[HVX] Simplify constant factor before distributing (#7009)" This reverts commit 69b50af793d6eb850eea3dccb16426479edbff9d. | 14 September 2022, 20:49:20 UTC |
ace8028 | Varun Sharma | 14 September 2022, 14:04:29 UTC | Add minimum GitHub token permissions for workflow (#7011) Signed-off-by: Varun Sharma <varunsh@stepsecurity.io> Signed-off-by: Varun Sharma <varunsh@stepsecurity.io> | 14 September 2022, 14:04:29 UTC |
655211e | Steven Johnson | 14 September 2022, 02:05:02 UTC | Rework Python Extension C++ code (again) (#7010) * Rework Python Extension C++ code (again) My previous effort was too clever for itself: while it worked for Halide's build systems, some other build systems (e.g. Blaze) are much more finicky about the C++ files you build Python extensions from, and re-using the same C++ files with different preprocessor settings turns out to be too problematic there, for reasons that aren't important here. Anyway, the important part here was to rework so that (1) All the C++ source files needed are compiled exactly once (2) All the C++ source files needed can be compiled with the same set of preprocessor definitions To that end, I have extended GenGen's `-r` flag to allow using `-e python_extension`; this emits the bare module-registration code by itself. So now, we generate the Python Extension code as before, but define HALIDE_PYTHON_EXTENSION_OMIT_MODULE_DEFINITION to defeat the standalone module registration for each one, then also compile in the new 'standalone' registration, with HALIDE_PYTHON_EXTENSION_MODULE and HALIDE_PYTHON_EXTENSION_FUNCTIONS defined to fill in the blanks. Also, a little drive-by cleanup in CodeGen_C to make extern "C" blocks more findable, and some restructuring in PyExtGen. * Update user_context_generator.cpp * Dummy source file * IF NOT EXISTS before file(WRITE) | 14 September 2022, 02:05:02 UTC |
27b8a7d | Alexander Root | 13 September 2022, 18:14:42 UTC | Add one-sided widening intrinsics. (#6967) * implement widen_right_ ops * update HVX patterns with one-sided widening intrinsics * remove unused HVX pattern flags * strengthen logic for finding rounding shifts Co-authored-by: Steven Johnson <srj@google.com> | 13 September 2022, 18:14:42 UTC |
69b50af | Alexander Root | 12 September 2022, 23:51:33 UTC | [HVX] Simplify constant factor before distributing (#7009) * simplify constant factor before distributing * add simd_op_check test | 12 September 2022, 23:51:33 UTC |
ff47ab0 | Andrew Adams | 12 September 2022, 16:25:26 UTC | Fix some bugs in div_round_to_zero (#7008) * Fix some bugs in div_round_to_zero ... and fast_integer_divide_round_to_zero These were never adequately tested, and there were a few issues. * Add missing print | 12 September 2022, 16:25:26 UTC |
a4f86de | Steven Johnson | 11 September 2022, 23:57:33 UTC | Fix Python handling of boolean buffers (#7006) The Python Extension code didn't handle boolean buffers correctly, making it impossible to construct one in Python and pass it thru to Halide-generated code. This fixes that, and also fixes the test that just expected it to fail (!). | 11 September 2022, 23:57:33 UTC |
c98f193 | Zalman Stern | 10 September 2022, 16:02:48 UTC | Couple small fixes to update RISC V to current LLVM flags and enable vscale use. (#6995) Couple small fixes to update RISC V to current LLVM flags and enable vscale use. Co-authored-by: Steven Johnson <srj@google.com> | 10 September 2022, 16:02:48 UTC |
a0a1d09 | Steven Johnson | 10 September 2022, 00:07:12 UTC | Prohibit C99 VLA usage in runtime code (#7005) * Prohibit C99 VLA usage in runtime code AFAICT we aren't doing this in Halide at present, but some experimental code in Google runtime was doing so; this caused some issues with some experimental Clang patches, but also was never really intended to be used in the first place. Adding the flag here to be sure no unintended use creeps back in. While I was there, took the time to ensure that the flags for runtime are unified across CMake and Make. * oops | 10 September 2022, 00:07:12 UTC |
4e352d3 | Steven Johnson | 09 September 2022, 16:49:26 UTC | Clean up Adams2019 CMake file (#7003) | 09 September 2022, 16:49:26 UTC |
bd74f94 | Steven Johnson | 08 September 2022, 00:40:05 UTC | Log target info in performance_fast_pow (#6997) (#6998) Try to gather info to track down heisenbug | 08 September 2022, 00:40:05 UTC |
e5069ef | Steven Johnson | 07 September 2022, 21:15:58 UTC | Apply _Halide_place_dll() to _Halide_gengen (#6999) (#7000) | 07 September 2022, 21:15:58 UTC |
1644e64 | Fangrui Song | 07 September 2022, 18:28:08 UTC | [Codegen] Adapt ModuleAddressSanitizerPass/ModuleSanitizerCoveragePass renaming (#6996) https://github.com/llvm/llvm-project/commit/93600eb50ceeec83c488ded24fa0fd25f997fec6 renamed ModuleAddressSanitizerPass to AddressSanitizerPass. https://github.com/llvm/llvm-project/commit/4c18670776cd6ac31099a455b2b22b38b0408006 renamed ModuleSanitizerCoveragePass. | 07 September 2022, 18:28:08 UTC |
cbe2e63 | Steven Johnson | 06 September 2022, 17:18:50 UTC | Fix compiler warnings in Elf.cpp (#6992) * Fix compiler warnings in Elf.cpp Some versions of GCC will complain that there is a possible use of uninitialized field `Sym<>::st_info` here; that's technically true, in that it is a bitfield that we previously set via two calls, so it temporarily could use uninitialized bits, but those would immediately be overwritten by well-defined bits. That said, the API could have been misused, so I collapsed Sym::set_type and Sym::set_bindings into a single call to avoid this warning. While I was there, I did a little hygiene on Rel<> and Rela<> as well, as there was an unused-but-similarly-dubious API there. Also added some C++17 `if constexpr` love. * Removed constexpr | 06 September 2022, 17:18:50 UTC |
8b9c081 | Alex Reinking | 02 September 2022, 01:55:43 UTC | Fixes for Xcode "new" build system. (#6993) 1. TargetExportScript was running into an Xcode bug with its handling of linker flags. Now using XCODE_ATTRIBUTE_EXPORTED_SYMBOLS_LIST as a workaround. 2. Added a missing dependency in Python module definition code. Fixes #6987 | 02 September 2022, 01:55:43 UTC |
ce2e7f3 | Steven Johnson | 01 September 2022, 17:58:57 UTC | Refactor buffer-unpacking code in PythonExtensionGen (#6991) This moves most of the interesting code into the common module block, so we don't risk duplicating code for extensions that contain multiple function definitions. | 01 September 2022, 17:58:57 UTC |
95e37ee | Steven Johnson | 31 August 2022, 21:44:17 UTC | Improve error-handling in Python Extensions (#6986) * Improve error-handling in Python Extensions Currently, Python Extensions don't make any effort to override `halide_error`, so the default (which aborts) is generally used... this is very unfriendly. This modifies the standard Python Extension glue code to hook halide_error, saving the text in a thread local, and then throwing a Python exception after the extension's AOT call is finished (if an error occurred, of course). Also does a drive-by default hooking of `halide_print` to ensure that it goes to whatever Python thinks that `stdout` is. (Note that it would be really nice if we could use closures of some sort for halide_error, halide_print, etc so that we could save context in the actual Python module, rather than in a thread-local global var, but this currently isn't possible without nontrivial refactoring in the Halide runtime.) * Make Windows happy * Remove dangling code bits * Allow defeating of error-handler via HALIDE_PYTHON_EXTENSION_OMIT_ERROR_AND_PRINT_HANDLERS | 31 August 2022, 21:44:17 UTC |
e531e24 | Alex Reinking | 31 August 2022, 16:55:51 UTC | Fix markdown links (#6988) | 31 August 2022, 16:55:51 UTC |
386e1ee | Steven Johnson | 30 August 2022, 20:19:58 UTC | Add `add_halide_runtime` rule (#6985) Fixes #6981 | 30 August 2022, 20:19:58 UTC |
e7c1c86 | Steven Johnson | 29 August 2022, 23:09:20 UTC | Add test for _Halide_target_export_single_symbol (#6983) Add test for _Halide_target_export_single_symbol | 29 August 2022, 23:09:20 UTC |
c24b406 | Steven Johnson | 29 August 2022, 20:48:23 UTC | Add add_halide_python_extension_library() rule (#6979) * Add add_halide_python_extension_library() rule This adds a rule to create a single Python extension library from one (or more) halide_library rules. This allows you to package multiple Halide filters into a single Python module, which is nice because (1) being able to organize is good, and (2) all the filters in a single Python extension module share the same Halide runtime, including (e.g.) thread pools and method overrides. (It also removes the just-recently-added PYTHON_EXTENSION_LIBRARY option from the add_halide_library rule, as this new rule is better and more flexible in pretty much every way.) This modifies the content of our `python_extension` output in such a way that existing uses should be completely unaffected, but defining the right preprocessor macros allows us to split the function wrappers up from the method-definition declaration, so we don't have to generate any new code artifiacts to make this work. Partially addresses #6956. * Omits -D in target_compile_definitions * be explicit about setting to empty * Add quotes * Add comments re BUILD_INTERFACE * Add MODULE_NAME comment * Remove "defined in HalideGeneratorHelpers.cmake" * Add comment re add_halide_runtime() * osx, macos, darwin, oh m * blankity blank blank * Use OBJECT library instead * Add comment about X-macros * Update HalideGeneratorHelpers.cmake | 29 August 2022, 20:48:23 UTC |
5a09dda | Alex Reinking | 26 August 2022, 00:42:26 UTC | Fix XCode by wrapping weights in an OBJECT library (#6977) The XCode "new build system" doesn't like generated source files to be associated with more than one target. Going through an OBJECT library like this fixes that problem, but also saves us a compilation, so it's a good thing to do anyway. Fixes #6976 | 26 August 2022, 00:42:26 UTC |
50018c4 | Zalman Stern | 25 August 2022, 23:01:39 UTC | Small refactor to remove confusion between CodeGen_LLVM and CodeGen_Internal. (#6973) * Small refactor to remove confusion between CodeGen_LLVM and CodeGen_Internal. | 25 August 2022, 23:01:39 UTC |
4877b9f | Alexander Root | 24 August 2022, 16:21:24 UTC | Lower saturating_cast in bounds inference (#6970) * lower saturating_cast in bounds inference * openGL fix to saturating_cast | 24 August 2022, 16:21:24 UTC |
068f1e2 | Alex Reinking | 24 August 2022, 00:35:10 UTC | Don't cache Halide_ASAN_ENABLED (#6969) check_cxx_symbol_exists saves its output in the cache and does not run if its destination variable is defined. This is OK when used to test something that necessitates a totally fresh configuration, like any property of the target architecture, which would require changing the toolchain file. However, the result here can change if someone just modifies CMAKE_CXX_FLAGS, so it can get out of sync in some cases. | 24 August 2022, 00:35:10 UTC |
eacadb6 | Alex Reinking | 24 August 2022, 00:35:00 UTC | Use CMake target to handle vendored SPIRV headers (#6968) | 24 August 2022, 00:35:00 UTC |
2f0957b | Alex Reinking | 23 August 2022, 19:38:51 UTC | CMake packaging fixes (#6966) * Add Halide_ASAN_ENABLED to package. * Fix handling of optional components. Make PNG/JPEG optional. * Make it easier to find HalideHelpers Before this change, users would either need to set Halide_ROOT to a Halide installation path or add said path to CMAKE_PREFIX_PATH. If they tried to use a different mechanism, like setting Halide_DIR or directly annotating their find_package call with HINTS or PATHS, then it would fail to find HalideHelpers.cmake. Adding this hint inside HalideConfig.cmake makes the package more robust, while still respecting the more powerful Halide_ROOT and CMAKE_PREFIX_PATH variables. * Delete undocumented variables in HalideConfig Some of our package's internal variables and macros leak out into user builds. We don't want users to use any of these. We might hit Hyrum's Law here, but I hope not. Users of these variables and macros should seek other means. | 23 August 2022, 19:38:51 UTC |
ca6319b | Alex Reinking | 23 August 2022, 04:07:09 UTC | Some minor top-level CMakeLists.txt reorganization (#6957) * Disables the usage warning when CMAKE_BUILD_TYPE is defined, but explicitly empty. * Overrides C++ standard variables using the cache (CMake 3.21+) * Allows including projects to build our tests, etc. but disables by default via PROJECT_IS_TOP_LEVEL (CMake 3.21+) * Removes misleading distrib target. * Removes deprecated clang-format target (use ./run-clang-format.sh instead) | 23 August 2022, 04:07:09 UTC |
37f7514 | Steven Johnson | 23 August 2022, 00:40:17 UTC | Python: don't crash for repr(Expr()) (#6962) | 23 August 2022, 00:40:17 UTC |
671b26d | Steven Johnson | 23 August 2022, 00:39:28 UTC | Enable deprecations warnings (#6555) * Enable deprecations warnings We currently disable deprecation warnings inside Halide. This re-enables them there, and also inside add_halide_generator(). | 23 August 2022, 00:39:28 UTC |
f7a30e0 | Alex Reinking | 22 August 2022, 18:35:26 UTC | Fix RPATH for Python wheels on macOS (#6958) | 22 August 2022, 18:35:26 UTC |
fd3bec3 | Alexander Root | 22 August 2022, 16:08:34 UTC | [HVX] Fix state_var issue (#6894) * fix HVX state_var issue * abort if host is nullptr | 22 August 2022, 16:08:34 UTC |
4bcd6fa | Steven Johnson | 19 August 2022, 21:17:21 UTC | Remove add_python_stub_extension(), adding the functionality to add_halide_generator() instead (#6952) * Remove add_python_aot_extension() rule in CMake Move it into `add_halide_library` instead, as another output option. (add_python_stub_extension will likely be moved as well, in a subsequent PR) * Update README_cmake.md * Skip Python tests when compiling for WASM * PyStubs * Update README_cmake.md * Update Generator.h * Update CMakeLists.txt * Revert "Update CMakeLists.txt" This reverts commit ed5bb00283f0e4fbdbea74adf497d4ff93b0c8d1. * fixes * fixes * Update CMakeLists.txt * fixes * fixes * fixes * Remove LIBRARY DESTINATION * Update CMakeLists.txt * fixup packaging Co-authored-by: Alex Reinking <reinking@google.com> | 19 August 2022, 21:17:21 UTC |
a1cd71c | Alex Reinking | 19 August 2022, 03:55:04 UTC | Build fixes for manylinux2014 (#6953) | 19 August 2022, 03:55:04 UTC |
1068403 | Steven Johnson | 17 August 2022, 23:20:43 UTC | Remove add_python_aot_extension() rule in CMake (#6949) * Remove add_python_aot_extension() rule in CMake Move it into `add_halide_library` instead, as another output option. (add_python_stub_extension will likely be moved as well, in a subsequent PR) * Update README_cmake.md * Skip Python tests when compiling for WASM | 17 August 2022, 23:20:43 UTC |
dd5fe8d | Alex Reinking | 17 August 2022, 22:17:40 UTC | Two quick build fixes (#6950) * ASLog is linked to autoscheduler MODULES; needs PIC * Out-of-source Python bindings just need libHalide, not imageio * Fixes to setup.py | 17 August 2022, 22:17:40 UTC |
807d988 | Alexander Root | 17 August 2022, 19:33:38 UTC | Handle saturating_cast in compute_expr_cost() (#6947) | 17 August 2022, 19:33:38 UTC |
5100ad6 | Steven Johnson | 17 August 2022, 01:06:52 UTC | Don't throw an exception from generate_filter_main (#6946) | 17 August 2022, 01:06:52 UTC |
4f5c53c | Steven Johnson | 16 August 2022, 22:15:53 UTC | Add/update Python Readme (#6939) * Add/update Python Readme This moves the Python README to the toplevel and reworks it considerably, adding details and updating various bits. Note that the Python documentation here is still incomplete; this is intended as a prelude to adding documentation for Python Generators in a future PR. | 16 August 2022, 22:15:53 UTC |
63d563f | Steven Johnson | 16 August 2022, 21:38:42 UTC | Export HalidePythonExtensionHelpers.cmake for installs (#6941) * Export HalidePythonExtensionHelpers.cmake for installs * oops * fixes * Fix broken code in target_export_script() * oops #2 * Add WITH_SOABI to stubs as well as AOT * More fixes * Update CMakePresets.json * Update CMakePresets.json | 16 August 2022, 21:38:42 UTC |
52b91a4 | Andrew Adams | 14 August 2022, 17:24:30 UTC | Add minimal useful implementation of extracting and concatenating bits (#6928) * Minimal approach to making Deinterleave correct for Reinterpret * Add minimal useful implementation of extracting and concatenating bits * clang-tidy * More clang-tidy fixes * Add missing error message * Add low-bit-depth noise test * Add test to cmake build * Fix power-of-two check * Remove dead object * Add little-endian comment to reinterpret IR node * Simplify concat_bits of single arg * Add missing second arg * Fix concat_bits call Co-authored-by: Andrew Adams <anadams@adobe.com> | 14 August 2022, 17:24:30 UTC |
f60a8fb | Steven Johnson | 12 August 2022, 20:45:37 UTC | Fix badly-merged CMakePresets.json file (#6936) | 12 August 2022, 20:45:37 UTC |
5e8f97b | Steven Johnson | 11 August 2022, 22:57:54 UTC | Add ASAN support to CMake via toolchain file (#6920) Add ASAN support Co-authored-by: Alex Reinking <reinking@google.com> | 11 August 2022, 22:57:54 UTC |
b734957 | Steven Johnson | 11 August 2022, 19:35:28 UTC | Add build & test presets for release and debug CMake builds (#6934) Also, drive-by rename of 'default' to 'base' to better imply the inheritance | 11 August 2022, 19:35:28 UTC |
4cdc2a1 | Steven Johnson | 11 August 2022, 19:30:57 UTC | Tutorial 10 needs to be skipped for Python when targeting Wasm (just as non-Python does) (#6932) * Tutorial 10 needs to be skipped for Python when targeting Wasm (just as non-Python does) * fixes * Update CMakeLists.txt | 11 August 2022, 19:30:57 UTC |
43e6a26 | Steven Johnson | 10 August 2022, 22:05:11 UTC | Rework internal PYTHONPATH maintenance (#6922) * Rework PYTHONPATH * Move pure-Python file copying logic to build time. * Use TARGET_RUNTIME_DLLS to copy all DLLs instead of just Halide. * Ensure that the last path component for Halide_Python is always `halide` * Simplify __init__.py now that it's copied to build tree * Add helper to de-duplicate PYTHONPATH test logic Fixes #6870 Co-authored-by: Alex Reinking <alex.reinking@gmail.com> Co-authored-by: Alex Reinking <reinking@google.com> | 10 August 2022, 22:05:11 UTC |
92de4a1 | Steven Johnson | 10 August 2022, 17:30:46 UTC | Halide::Error should not extend std::runtime_error (#6927) * Halide::Error should not extend std::runtime_error Unfortunately, the std error/exception classes aren't marked for DLLEXPORT under MSVC; we need our Error classes to be DLLEXPORT for libHalide (and python bindings). The current situation basically causes MSVC to generator another version of `std::runtime_error` marked for DLLEXPORT, which can lead to ODR violations, which are bad. AFAICT we don't really rely on this inheritance anywhere, so this just eliminates the inheritance entirely. (Note that I can't point to a specific malfunction resulting from this, but casual googling based on the many warnings MSVC emits about the current situation has me convinced that it needs addressing.) * noexcept | 10 August 2022, 17:30:46 UTC |
1bf1599 | Alexander Root | 08 August 2022, 21:24:16 UTC | Make saturating_cast an intrinsic (#6900) * Make saturating_cast an intrinsic * handle saturating_cast in Bounds.cpp + add bounds tests * update saturating_cast CodeGen * with_lanes should work on intrinsics as well * lift to saturating_cast in FindIntrinsics * update intrinsics test for u16_sat * better sat_cast(widen(expr)) handling in find_intrinsics * simplify bounds of saturating_cast + update is_monotonic | 08 August 2022, 21:24:16 UTC |
8794fac | Alex Reinking | 08 August 2022, 20:44:32 UTC | Make use of CMake 3.22 features (#6919) * Remove AddCudaToTarget.cmake * Remove MakeShellPath.cmake * Use CheckLinkerFlag in TargetExportScript * Use DEPFILE for all generators * Use REQUIRED with find_program, where applicable * Use REQUIRED with find_library, where applicable * Use CMake 3.21 cache behavior in HalideTargetHelpers.cmake * Replace uses of get_filename_component with cmake_path * Rework BLAS detection in linear_algebra app * Drive-by: fix autotune_loop.sh install rule. * Fix CBLAS header in linear_algebra test_halide_blas | 08 August 2022, 20:44:32 UTC |
9ca7560 | Steven Johnson | 05 August 2022, 02:20:29 UTC | Fix wrong install path for *.py files (#6921) * Fix wrong install path for *.py files We were looking in a nonexistent dir, so we never copied `__init__.py` as we should have. * Update CMakeLists.txt | 05 August 2022, 02:20:29 UTC |
256c4d9 | Andrew Adams | 04 August 2022, 20:21:01 UTC | Fix bug when realize condition depends on tuple call (#6915) If the realization is tuple-valued, and the condition on the realization uses a tuple call (index != 0), then the condition wasn't getting resolved during the split_tuples pass. The cause was a missing mutate call. | 04 August 2022, 20:21:01 UTC |
ffa2c36 | Steven Johnson | 04 August 2022, 20:10:37 UTC | Fix two warnings found with clang 16 (#6918) - variable 'count' set but not used - warning: use of bitwise '|' with boolean operands | 04 August 2022, 20:10:37 UTC |
3a04fc0 | Alex Reinking | 04 August 2022, 14:00:45 UTC | Remove unused GHA and packaging workflows. (#6917) | 04 August 2022, 14:00:45 UTC |
cc44ee5 | Steven Johnson | 04 August 2022, 01:40:22 UTC | Upgrade CMake minimum version to 3.22 (#6916) Fixes #6910. | 04 August 2022, 01:40:22 UTC |
857b045 | Steven Johnson | 03 August 2022, 22:24:43 UTC | LICENSE.txt: add BLAS license. (#6914) | 03 August 2022, 22:24:43 UTC |