halide 19.0.0__cp39-cp39-macosx_11_0_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.
- halide/__init__.py +39 -0
- halide/_generator_helpers.py +835 -0
- halide/bin/adams2019_retrain_cost_model +0 -0
- halide/bin/adams2019_weightsdir_to_weightsfile +0 -0
- halide/bin/anderson2021_retrain_cost_model +0 -0
- halide/bin/anderson2021_weightsdir_to_weightsfile +0 -0
- halide/bin/featurization_to_sample +0 -0
- halide/bin/gengen +0 -0
- halide/bin/get_host_target +0 -0
- halide/halide_.cpython-39-darwin.so +0 -0
- halide/imageio.py +60 -0
- halide/include/Halide.h +35293 -0
- halide/include/HalideBuffer.h +2618 -0
- halide/include/HalidePyTorchCudaHelpers.h +64 -0
- halide/include/HalidePyTorchHelpers.h +120 -0
- halide/include/HalideRuntime.h +2221 -0
- halide/include/HalideRuntimeCuda.h +89 -0
- halide/include/HalideRuntimeD3D12Compute.h +91 -0
- halide/include/HalideRuntimeHexagonDma.h +104 -0
- halide/include/HalideRuntimeHexagonHost.h +157 -0
- halide/include/HalideRuntimeMetal.h +112 -0
- halide/include/HalideRuntimeOpenCL.h +119 -0
- halide/include/HalideRuntimeQurt.h +32 -0
- halide/include/HalideRuntimeVulkan.h +137 -0
- halide/include/HalideRuntimeWebGPU.h +44 -0
- halide/lib/cmake/Halide/FindHalide_LLVM.cmake +152 -0
- halide/lib/cmake/Halide/FindV8.cmake +33 -0
- halide/lib/cmake/Halide/Halide-shared-deps.cmake +0 -0
- halide/lib/cmake/Halide/Halide-shared-targets-release.cmake +29 -0
- halide/lib/cmake/Halide/Halide-shared-targets.cmake +154 -0
- halide/lib/cmake/Halide/HalideConfig.cmake +162 -0
- halide/lib/cmake/Halide/HalideConfigVersion.cmake +65 -0
- halide/lib/cmake/HalideHelpers/FindHalide_WebGPU.cmake +27 -0
- halide/lib/cmake/HalideHelpers/Halide-Interfaces-release.cmake +116 -0
- halide/lib/cmake/HalideHelpers/Halide-Interfaces.cmake +236 -0
- halide/lib/cmake/HalideHelpers/HalideGeneratorHelpers.cmake +1056 -0
- halide/lib/cmake/HalideHelpers/HalideHelpersConfig.cmake +28 -0
- halide/lib/cmake/HalideHelpers/HalideHelpersConfigVersion.cmake +54 -0
- halide/lib/cmake/HalideHelpers/HalideTargetHelpers.cmake +99 -0
- halide/lib/cmake/HalideHelpers/MutexCopy.ps1 +31 -0
- halide/lib/cmake/HalideHelpers/TargetExportScript.cmake +55 -0
- halide/lib/cmake/Halide_Python/Halide_Python-targets-release.cmake +30 -0
- halide/lib/cmake/Halide_Python/Halide_Python-targets.cmake +125 -0
- halide/lib/cmake/Halide_Python/Halide_PythonConfig.cmake +26 -0
- halide/lib/cmake/Halide_Python/Halide_PythonConfigVersion.cmake +65 -0
- halide/lib/libHalide.dylib +0 -0
- halide/lib/libHalidePyStubs.a +0 -0
- halide/lib/libHalide_GenGen.a +0 -0
- halide/lib/libautoschedule_adams2019.so +0 -0
- halide/lib/libautoschedule_anderson2021.so +0 -0
- halide/lib/libautoschedule_li2018.so +0 -0
- halide/lib/libautoschedule_mullapudi2016.so +0 -0
- halide/share/doc/Halide/LICENSE.txt +233 -0
- halide/share/doc/Halide/README.md +439 -0
- halide/share/doc/Halide/doc/BuildingHalideWithCMake.md +626 -0
- halide/share/doc/Halide/doc/CodeStyleCMake.md +393 -0
- halide/share/doc/Halide/doc/FuzzTesting.md +104 -0
- halide/share/doc/Halide/doc/HalideCMakePackage.md +812 -0
- halide/share/doc/Halide/doc/Hexagon.md +73 -0
- halide/share/doc/Halide/doc/Python.md +844 -0
- halide/share/doc/Halide/doc/RunGen.md +283 -0
- halide/share/doc/Halide/doc/Testing.md +125 -0
- halide/share/doc/Halide/doc/Vulkan.md +287 -0
- halide/share/doc/Halide/doc/WebAssembly.md +228 -0
- halide/share/doc/Halide/doc/WebGPU.md +128 -0
- halide/share/tools/RunGen.h +1470 -0
- halide/share/tools/RunGenMain.cpp +642 -0
- halide/share/tools/adams2019_autotune_loop.sh +227 -0
- halide/share/tools/anderson2021_autotune_loop.sh +591 -0
- halide/share/tools/halide_benchmark.h +240 -0
- halide/share/tools/halide_image.h +31 -0
- halide/share/tools/halide_image_info.h +318 -0
- halide/share/tools/halide_image_io.h +2794 -0
- halide/share/tools/halide_malloc_trace.h +102 -0
- halide/share/tools/halide_thread_pool.h +161 -0
- halide/share/tools/halide_trace_config.h +559 -0
- halide-19.0.0.data/data/share/cmake/Halide/HalideConfig.cmake +6 -0
- halide-19.0.0.data/data/share/cmake/Halide/HalideConfigVersion.cmake +65 -0
- halide-19.0.0.data/data/share/cmake/HalideHelpers/HalideHelpersConfig.cmake +6 -0
- halide-19.0.0.data/data/share/cmake/HalideHelpers/HalideHelpersConfigVersion.cmake +54 -0
- halide-19.0.0.dist-info/METADATA +301 -0
- halide-19.0.0.dist-info/RECORD +84 -0
- halide-19.0.0.dist-info/WHEEL +5 -0
- halide-19.0.0.dist-info/licenses/LICENSE.txt +233 -0
@@ -0,0 +1,32 @@
|
|
1
|
+
#ifndef HALIDE_HALIDERUNTIMEQURT_H
|
2
|
+
#define HALIDE_HALIDERUNTIMEQURT_H
|
3
|
+
|
4
|
+
// Don't include HalideRuntime.h if the contents of it were already pasted into a generated header above this one
|
5
|
+
#ifndef HALIDE_HALIDERUNTIME_H
|
6
|
+
|
7
|
+
#include "HalideRuntime.h"
|
8
|
+
|
9
|
+
#endif
|
10
|
+
|
11
|
+
#ifdef __cplusplus
|
12
|
+
extern "C" {
|
13
|
+
#endif
|
14
|
+
|
15
|
+
/** \file
|
16
|
+
* Routines specific to the Halide QuRT runtime.
|
17
|
+
*/
|
18
|
+
|
19
|
+
/** Lock and unlock an HVX context.
|
20
|
+
* A successful call to hvx_lock must be followed by a call to
|
21
|
+
* hvx_unlock. */
|
22
|
+
// @{
|
23
|
+
extern int halide_qurt_hvx_lock(void *user_context);
|
24
|
+
extern int halide_qurt_hvx_unlock(void *user_context);
|
25
|
+
extern void halide_qurt_hvx_unlock_as_destructor(void *user_context, void * /*obj*/);
|
26
|
+
// @}
|
27
|
+
|
28
|
+
#ifdef __cplusplus
|
29
|
+
} // End extern "C"
|
30
|
+
#endif
|
31
|
+
|
32
|
+
#endif // HALIDE_HALIDERUNTIMEQURT_H
|
@@ -0,0 +1,137 @@
|
|
1
|
+
#ifndef HALIDE_HALIDERUNTIMEVULKAN_H
|
2
|
+
#define HALIDE_HALIDERUNTIMEVULKAN_H
|
3
|
+
|
4
|
+
// Don't include HalideRuntime.h if the contents of it were already pasted into a generated header above this one
|
5
|
+
#ifndef HALIDE_HALIDERUNTIME_H
|
6
|
+
|
7
|
+
#include "HalideRuntime.h"
|
8
|
+
|
9
|
+
#endif
|
10
|
+
/** \file
|
11
|
+
* Routines specific to the Halide Vulkan runtime.
|
12
|
+
*/
|
13
|
+
|
14
|
+
#ifdef __cplusplus
|
15
|
+
extern "C" {
|
16
|
+
#endif
|
17
|
+
|
18
|
+
#define HALIDE_RUNTIME_VULKAN
|
19
|
+
|
20
|
+
// Guard against redefining handles if vulkan.h was included elsewhere
|
21
|
+
#ifndef VK_DEFINE_HANDLE
|
22
|
+
|
23
|
+
#define HALIDE_VULKAN_DEFINE_HANDLE(object) typedef struct object##_T *(object);
|
24
|
+
|
25
|
+
#ifndef HALIDE_VULKAN_USE_64_BIT_PTR_DEFINES
|
26
|
+
#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__)) || defined(_M_X64) || defined(__ia64) || defined(_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) || (defined(__riscv) && __riscv_xlen == 64)
|
27
|
+
#define HALIDE_VULKAN_USE_64_BIT_PTR_DEFINES 1
|
28
|
+
#else
|
29
|
+
#define HALIDE_VULKAN_USE_64_BIT_PTR_DEFINES 0
|
30
|
+
#endif
|
31
|
+
#endif
|
32
|
+
|
33
|
+
#ifndef HALIDE_VULKAN_DEFINE_NON_DISPATCHABLE_HANDLE
|
34
|
+
#if (HALIDE_VULKAN_USE_64_BIT_PTR_DEFINES == 1)
|
35
|
+
#define HALIDE_VULKAN_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *(object);
|
36
|
+
#else
|
37
|
+
#define HALIDE_VULKAN_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t(object);
|
38
|
+
#endif
|
39
|
+
#endif
|
40
|
+
|
41
|
+
HALIDE_VULKAN_DEFINE_HANDLE(VkInstance)
|
42
|
+
HALIDE_VULKAN_DEFINE_HANDLE(VkPhysicalDevice)
|
43
|
+
HALIDE_VULKAN_DEFINE_HANDLE(VkDevice)
|
44
|
+
HALIDE_VULKAN_DEFINE_HANDLE(VkQueue)
|
45
|
+
HALIDE_VULKAN_DEFINE_NON_DISPATCHABLE_HANDLE(VkCommandPool)
|
46
|
+
HALIDE_VULKAN_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugUtilsMessengerEXT)
|
47
|
+
|
48
|
+
#endif
|
49
|
+
|
50
|
+
extern const struct halide_device_interface_t *halide_vulkan_device_interface();
|
51
|
+
|
52
|
+
/** These are forward declared here to allow clients to override the
|
53
|
+
* Halide Vulkan runtime. Do not call them. */
|
54
|
+
// @{
|
55
|
+
extern int halide_vulkan_initialize_kernels(void *user_context, void **state_ptr,
|
56
|
+
const char *src, int size);
|
57
|
+
|
58
|
+
extern int halide_vulkan_run(void *user_context,
|
59
|
+
void *state_ptr,
|
60
|
+
const char *entry_name,
|
61
|
+
int blocksX, int blocksY, int blocksZ,
|
62
|
+
int threadsX, int threadsY, int threadsZ,
|
63
|
+
int shared_mem_bytes,
|
64
|
+
size_t arg_sizes[],
|
65
|
+
void *args[],
|
66
|
+
int8_t arg_is_buffer[]);
|
67
|
+
|
68
|
+
extern void halide_vulkan_finalize_kernels(void *user_context, void *state_ptr);
|
69
|
+
|
70
|
+
// @}
|
71
|
+
|
72
|
+
// The default implementation of halide_acquire_vulkan_context uses
|
73
|
+
// the global pointers above, and serializes access with a spin lock.
|
74
|
+
// Overriding implementations of acquire/release must implement the
|
75
|
+
// following behavior:
|
76
|
+
|
77
|
+
// - halide_acquire_vulkan_context should always store a valid
|
78
|
+
// instance/device/queue in the corresponding out parameters,
|
79
|
+
// or return an error code.
|
80
|
+
// - A call to halide_acquire_vulkan_context is followed by a matching
|
81
|
+
// call to halide_release_vulkan_context. halide_acquire_vulkan_context
|
82
|
+
// should block while a previous call (if any) has not yet been
|
83
|
+
// released via halide_release_vulkan_context.
|
84
|
+
// - Parameters:
|
85
|
+
// allocator: an internal halide type handle used for allocating resources
|
86
|
+
// instance: the vulkan instance handle
|
87
|
+
// device: the vulkan device handle
|
88
|
+
// physical_device: the vulkan physical device handle
|
89
|
+
// queue: the vulkan queue handle
|
90
|
+
// queue_family_index: the index corresponding to the device queue properties for the device (as described by vkGetPhysicalDeviceQueueFamilyProperties)
|
91
|
+
// create: if set to true, attempt to create a new vulkan context, otherwise acquire the current one
|
92
|
+
struct halide_vulkan_memory_allocator;
|
93
|
+
extern int halide_vulkan_acquire_context(void *user_context,
|
94
|
+
struct halide_vulkan_memory_allocator **allocator,
|
95
|
+
VkInstance *instance,
|
96
|
+
VkDevice *device,
|
97
|
+
VkPhysicalDevice *physical_device,
|
98
|
+
VkQueue *queue,
|
99
|
+
uint32_t *queue_family_index,
|
100
|
+
VkDebugUtilsMessengerEXT *messenger,
|
101
|
+
bool create = true);
|
102
|
+
|
103
|
+
extern int halide_vulkan_release_context(void *user_context,
|
104
|
+
VkInstance instance,
|
105
|
+
VkDevice device,
|
106
|
+
VkQueue queue,
|
107
|
+
VkDebugUtilsMessengerEXT messenger);
|
108
|
+
// --
|
109
|
+
|
110
|
+
// Override the default allocation callbacks (default uses Vulkan runtime implementation)
|
111
|
+
extern void halide_vulkan_set_allocation_callbacks(const struct VkAllocationCallbacks *callbacks);
|
112
|
+
|
113
|
+
// Access the current allocation callbacks
|
114
|
+
// -- may return nullptr ... which indicates the default Vulkan runtime implementation is being used)
|
115
|
+
extern const struct VkAllocationCallbacks *halide_vulkan_get_allocation_callbacks(void *user_context);
|
116
|
+
|
117
|
+
// Access methods to assign/retrieve required layer names for the context
|
118
|
+
extern void halide_vulkan_set_layer_names(const char *n);
|
119
|
+
extern const char *halide_vulkan_get_layer_names(void *user_context);
|
120
|
+
|
121
|
+
// Access methods to assign/retrieve required externsion names for the context
|
122
|
+
extern void halide_vulkan_set_extension_names(const char *n);
|
123
|
+
extern const char *halide_vulkan_get_extension_names(void *user_context);
|
124
|
+
|
125
|
+
// Access methods to assign/retrieve required device type names for the context (either "cpu", "gpu" (any), "discrete-gpu" (only), "virtual-gpu" (sw))
|
126
|
+
extern void halide_vulkan_set_device_type(const char *n);
|
127
|
+
extern const char *halide_vulkan_get_device_type(void *user_context);
|
128
|
+
|
129
|
+
// Access methods to assign/retrieve specific build options to the Vulkan runtime compiler
|
130
|
+
extern void halide_vulkan_set_build_options(const char *n);
|
131
|
+
extern const char *halide_vulkan_get_build_options(void *user_context);
|
132
|
+
|
133
|
+
#ifdef __cplusplus
|
134
|
+
} // End extern "C"
|
135
|
+
#endif
|
136
|
+
|
137
|
+
#endif // HALIDE_HALIDERUNTIMEVULKAN_H
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#ifndef HALIDE_HALIDERUNTIMEWEBGPU_H
|
2
|
+
#define HALIDE_HALIDERUNTIMEWEBGPU_H
|
3
|
+
|
4
|
+
// Don't include HalideRuntime.h if the contents of it were already pasted into a generated header above this one
|
5
|
+
#ifndef HALIDE_HALIDERUNTIME_H
|
6
|
+
|
7
|
+
#include "HalideRuntime.h"
|
8
|
+
|
9
|
+
#endif
|
10
|
+
|
11
|
+
#ifdef __cplusplus
|
12
|
+
extern "C" {
|
13
|
+
#endif
|
14
|
+
|
15
|
+
/** \file
|
16
|
+
* Routines specific to the Halide WebGPU runtime.
|
17
|
+
*/
|
18
|
+
|
19
|
+
#define HALIDE_RUNTIME_WEBGPU
|
20
|
+
|
21
|
+
extern const struct halide_device_interface_t *halide_webgpu_device_interface();
|
22
|
+
|
23
|
+
/** These are forward declared here to allow clients to override the
|
24
|
+
* Halide WebGPU runtime. Do not call them. */
|
25
|
+
// @{
|
26
|
+
extern int halide_webgpu_initialize_kernels(void *user_context, void **state_ptr,
|
27
|
+
const char *src, int size);
|
28
|
+
extern int halide_webgpu_run(void *user_context,
|
29
|
+
void *state_ptr,
|
30
|
+
const char *entry_name,
|
31
|
+
int blocksX, int blocksY, int blocksZ,
|
32
|
+
int threadsX, int threadsY, int threadsZ,
|
33
|
+
int shared_mem_bytes,
|
34
|
+
halide_type_t arg_types[],
|
35
|
+
void *args[],
|
36
|
+
int8_t arg_is_buffer[]);
|
37
|
+
extern void halide_webgpu_finalize_kernels(void *user_context, void *state_ptr);
|
38
|
+
// @}
|
39
|
+
|
40
|
+
#ifdef __cplusplus
|
41
|
+
} // End extern "C"
|
42
|
+
#endif
|
43
|
+
|
44
|
+
#endif // HALIDE_HALIDERUNTIMEWEBGPU_H
|
@@ -0,0 +1,152 @@
|
|
1
|
+
# This file wraps the upstream package config modules for LLVM, Clang, and LLD
|
2
|
+
# to fix pathological issues in their implementations. It creates imported targets
|
3
|
+
# that wrap the key features needed by Halide.
|
4
|
+
|
5
|
+
set(REASON_FAILURE_MESSAGE "")
|
6
|
+
|
7
|
+
# Fallback configurations for weirdly built LLVMs
|
8
|
+
set(CMAKE_MAP_IMPORTED_CONFIG_MINSIZEREL MinSizeRel Release RelWithDebInfo "")
|
9
|
+
set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo Release MinSizeRel "")
|
10
|
+
set(CMAKE_MAP_IMPORTED_CONFIG_RELEASE Release MinSizeRel RelWithDebInfo "")
|
11
|
+
|
12
|
+
find_package(LLVM ${PACKAGE_FIND_VERSION} CONFIG)
|
13
|
+
|
14
|
+
set(Halide_LLVM_VERSION "${LLVM_PACKAGE_VERSION}")
|
15
|
+
|
16
|
+
# TODO: deprecated in Halide 19.0.0, remove in Halide 20.0.0
|
17
|
+
if (NOT DEFINED Halide_LLVM_SHARED_LIBS AND DEFINED Halide_SHARED_LLVM)
|
18
|
+
set(Halide_LLVM_SHARED_LIBS "${Halide_SHARED_LLVM}")
|
19
|
+
message(DEPRECATION
|
20
|
+
"Halide_SHARED_LLVM has been renamed to Halide_LLVM_SHARED_LIBS.")
|
21
|
+
endif ()
|
22
|
+
|
23
|
+
if (NOT DEFINED Halide_LLVM_SHARED_LIBS)
|
24
|
+
# Normally, we don't like making decisions for our users. However,
|
25
|
+
# this avoids an incompatible scenario that is checked below. So
|
26
|
+
# if we didn't do this, the package would fail to be found and
|
27
|
+
# the user would have to either rebuild LLVM or flip this value.
|
28
|
+
if (LLVM_FOUND AND "WebAssembly" IN_LIST LLVM_TARGETS_TO_BUILD AND LLVM_LINK_LLVM_DYLIB)
|
29
|
+
set(Halide_LLVM_SHARED_LIBS YES)
|
30
|
+
else ()
|
31
|
+
set(Halide_LLVM_SHARED_LIBS NO)
|
32
|
+
endif ()
|
33
|
+
endif ()
|
34
|
+
|
35
|
+
option(Halide_LLVM_SHARED_LIBS "Enable to link to shared libLLVM" "${Halide_LLVM_SHARED_LIBS}")
|
36
|
+
|
37
|
+
if (LLVM_FOUND)
|
38
|
+
find_package(Clang HINTS "${LLVM_INSTALL_PREFIX}" "${LLVM_DIR}/../clang" "${LLVM_DIR}/../lib/cmake/clang")
|
39
|
+
|
40
|
+
foreach (comp IN LISTS LLVM_TARGETS_TO_BUILD)
|
41
|
+
if (comp STREQUAL "WebAssembly")
|
42
|
+
set(Halide_LLVM_${comp}_FOUND 0)
|
43
|
+
|
44
|
+
find_package(LLD HINTS "${LLVM_INSTALL_PREFIX}" "${LLVM_DIR}/../lld" "${LLVM_DIR}/../lib/cmake/lld")
|
45
|
+
if (NOT LLD_FOUND)
|
46
|
+
string(APPEND REASON_FAILURE_MESSAGE
|
47
|
+
"WebAssembly was not found because liblld is missing. "
|
48
|
+
"Did you `apt install liblld-dev` or `brew install lld`?\n")
|
49
|
+
continue()
|
50
|
+
endif ()
|
51
|
+
|
52
|
+
# LLVM has a mis-feature that allows it to build and export both static and shared libraries at the same
|
53
|
+
# time, while inconsistently linking its own static libraries (for lldWasm and others) to the shared
|
54
|
+
# library. Ignoring this causes Halide to link to both the static AND the shared LLVM libs and it breaks at
|
55
|
+
# runtime. See: https://github.com/halide/Halide/issues/5471
|
56
|
+
if (LLVM_LINK_LLVM_DYLIB AND NOT Halide_LLVM_SHARED_LIBS)
|
57
|
+
string(APPEND REASON_FAILURE_MESSAGE
|
58
|
+
"WebAssembly was not found because LLD required by was linked to shared LLVM "
|
59
|
+
"(LLVM_LINK_LLVM_DYLIB=${LLVM_LINK_LLVM_DYLIB}) but static LLVM was requested "
|
60
|
+
"(Halide_LLVM_SHARED_LIBS=${Halide_LLVM_SHARED_LIBS}).\n")
|
61
|
+
continue()
|
62
|
+
endif ()
|
63
|
+
endif ()
|
64
|
+
|
65
|
+
set(Halide_LLVM_${comp}_FOUND 1)
|
66
|
+
endforeach ()
|
67
|
+
|
68
|
+
set(Halide_LLVM_SHARED_LIBRARY "LLVM")
|
69
|
+
if (Halide_LLVM_SHARED_LIBS AND NOT TARGET "${Halide_LLVM_SHARED_LIBRARY}")
|
70
|
+
string(APPEND Halide_LLVM_SHARED_LIBRARY "-NOTFOUND")
|
71
|
+
string(APPEND REASON_FAILURE_MESSAGE
|
72
|
+
"Halide_LLVM_SHARED_LIBS=${Halide_LLVM_SHARED_LIBS} but the shared LLVM target does not exist.\n")
|
73
|
+
endif ()
|
74
|
+
endif ()
|
75
|
+
|
76
|
+
include(FindPackageHandleStandardArgs)
|
77
|
+
find_package_handle_standard_args(
|
78
|
+
Halide_LLVM
|
79
|
+
REQUIRED_VARS LLVM_CONFIG Clang_CONFIG Halide_LLVM_SHARED_LIBRARY
|
80
|
+
VERSION_VAR Halide_LLVM_VERSION
|
81
|
+
REASON_FAILURE_MESSAGE "${REASON_FAILURE_MESSAGE}"
|
82
|
+
HANDLE_COMPONENTS
|
83
|
+
HANDLE_VERSION_RANGE
|
84
|
+
NAME_MISMATCHED
|
85
|
+
)
|
86
|
+
|
87
|
+
function(_Halide_LLVM_link target visibility)
|
88
|
+
llvm_map_components_to_libnames(comps ${ARGN})
|
89
|
+
target_link_libraries("${target}" "${visibility}" ${comps})
|
90
|
+
endfunction()
|
91
|
+
|
92
|
+
if (Halide_LLVM_FOUND)
|
93
|
+
set(Halide_LLVM_COMPONENTS "")
|
94
|
+
foreach (comp IN LISTS Halide_LLVM_FIND_COMPONENTS)
|
95
|
+
if (Halide_LLVM_${comp}_FOUND)
|
96
|
+
list(APPEND Halide_LLVM_COMPONENTS "${comp}")
|
97
|
+
endif ()
|
98
|
+
endforeach ()
|
99
|
+
|
100
|
+
if (NOT TARGET Halide_LLVM::Core)
|
101
|
+
add_library(Halide_LLVM::Core INTERFACE IMPORTED)
|
102
|
+
|
103
|
+
# LLVM_DEFINITIONS is a space-separated list instead of a more typical
|
104
|
+
# CMake semicolon-separated list. For a long time, CMake could handle
|
105
|
+
# this transparently but, since LLVM 17, the flag -D_FILE_OFFSET_BITS=64
|
106
|
+
# appears on 32-bit Linux. The presence of the `=` here stops CMake
|
107
|
+
# from splitting on spaces, instead corrupting the command line by
|
108
|
+
# folding the other flags into the value of -D_FILE_OFFSET_BITS=64.
|
109
|
+
# For better or worse, since the flag also appears twice, the second
|
110
|
+
# `=` is folded into the value of the first and we get errors of the
|
111
|
+
# form:
|
112
|
+
#
|
113
|
+
# <command-line>: error: token "=" is not valid in preprocessor expressions
|
114
|
+
#
|
115
|
+
separate_arguments(LLVM_DEFINITIONS NATIVE_COMMAND "${LLVM_DEFINITIONS}")
|
116
|
+
list(REMOVE_ITEM LLVM_DEFINITIONS "-D_GLIBCXX_ASSERTIONS") # work around https://reviews.llvm.org/D142279
|
117
|
+
list(APPEND LLVM_DEFINITIONS "LLVM_VERSION=${LLVM_VERSION_MAJOR}${LLVM_VERSION_MINOR}")
|
118
|
+
|
119
|
+
target_compile_definitions(Halide_LLVM::Core INTERFACE ${LLVM_DEFINITIONS})
|
120
|
+
target_include_directories(Halide_LLVM::Core INTERFACE "${LLVM_INCLUDE_DIRS}")
|
121
|
+
|
122
|
+
set_property(TARGET Halide_LLVM::Core PROPERTY INTERFACE_CXX_RTTI "${LLVM_ENABLE_RTTI}")
|
123
|
+
set_property(TARGET Halide_LLVM::Core APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL CXX_RTTI)
|
124
|
+
|
125
|
+
if (LLVM_LIBCXX GREATER -1)
|
126
|
+
target_compile_options(Halide_LLVM::Core INTERFACE "$<$<LINK_LANGUAGE:CXX>:-stdlib=libc++>")
|
127
|
+
target_link_options(Halide_LLVM::Core INTERFACE "$<$<LINK_LANGUAGE:CXX>:-stdlib=libc++>")
|
128
|
+
endif ()
|
129
|
+
|
130
|
+
if (Halide_LLVM_SHARED_LIBS)
|
131
|
+
target_link_libraries(Halide_LLVM::Core INTERFACE LLVM ${CMAKE_DL_LIBS})
|
132
|
+
else ()
|
133
|
+
_Halide_LLVM_link(Halide_LLVM::Core INTERFACE orcjit bitwriter linker passes)
|
134
|
+
endif ()
|
135
|
+
endif ()
|
136
|
+
|
137
|
+
foreach (comp IN LISTS Halide_LLVM_COMPONENTS)
|
138
|
+
if (NOT TARGET Halide_LLVM::${comp})
|
139
|
+
add_library(Halide_LLVM::${comp} INTERFACE IMPORTED)
|
140
|
+
target_link_libraries(Halide_LLVM::${comp} INTERFACE Halide_LLVM::Core)
|
141
|
+
|
142
|
+
if (NOT Halide_LLVM_SHARED_LIBS)
|
143
|
+
_Halide_LLVM_link(Halide_LLVM::${comp} INTERFACE ${comp})
|
144
|
+
endif ()
|
145
|
+
|
146
|
+
if (comp STREQUAL "WebAssembly")
|
147
|
+
target_include_directories(Halide_LLVM::WebAssembly INTERFACE ${LLD_INCLUDE_DIRS})
|
148
|
+
target_link_libraries(Halide_LLVM::WebAssembly INTERFACE lldWasm lldCommon)
|
149
|
+
endif ()
|
150
|
+
endif ()
|
151
|
+
endforeach ()
|
152
|
+
endif ()
|
@@ -0,0 +1,33 @@
|
|
1
|
+
if (EXISTS "${V8_INCLUDE_PATH}")
|
2
|
+
message(DEPRECATION "V8_INCLUDE_PATH has been renamed to V8_INCLUDE_DIR")
|
3
|
+
set(V8_INCLUDE_DIR "${V8_INCLUDE_PATH}")
|
4
|
+
set(V8_INCLUDE_DIR "${V8_INCLUDE_PATH}" CACHE PATH "")
|
5
|
+
endif ()
|
6
|
+
|
7
|
+
find_path(V8_INCLUDE_DIR v8.h)
|
8
|
+
|
9
|
+
if (EXISTS "${V8_LIB_PATH}")
|
10
|
+
message(DEPRECATION "V8_LIB_PATH has been renamed to V8_LIBRARY")
|
11
|
+
set(V8_LIBRARY "${V8_LIB_PATH}")
|
12
|
+
set(V8_LIBRARY "${V8_LIB_PATH}" CACHE FILEPATH "")
|
13
|
+
endif ()
|
14
|
+
|
15
|
+
find_library(
|
16
|
+
V8_LIBRARY
|
17
|
+
NAMES v8_monolith
|
18
|
+
PATH_SUFFIXES
|
19
|
+
out.gn/x64.release.sample/obj
|
20
|
+
)
|
21
|
+
|
22
|
+
include(FindPackageHandleStandardArgs)
|
23
|
+
find_package_handle_standard_args(
|
24
|
+
V8
|
25
|
+
REQUIRED_VARS V8_LIBRARY V8_INCLUDE_DIR
|
26
|
+
HANDLE_COMPONENTS
|
27
|
+
)
|
28
|
+
|
29
|
+
if (V8_FOUND AND NOT TARGET V8::V8)
|
30
|
+
add_library(V8::V8 UNKNOWN IMPORTED)
|
31
|
+
set_target_properties(V8::V8 PROPERTIES IMPORTED_LOCATION "${V8_LIBRARY}")
|
32
|
+
target_include_directories(V8::V8 INTERFACE "${V8_INCLUDE_DIR}")
|
33
|
+
endif ()
|
File without changes
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#----------------------------------------------------------------
|
2
|
+
# Generated CMake target import file for configuration "Release".
|
3
|
+
#----------------------------------------------------------------
|
4
|
+
|
5
|
+
# Commands may need to know the format version.
|
6
|
+
set(CMAKE_IMPORT_FILE_VERSION 1)
|
7
|
+
|
8
|
+
# Import target "Halide::Halide" for configuration "Release"
|
9
|
+
set_property(TARGET Halide::Halide APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
10
|
+
set_target_properties(Halide::Halide PROPERTIES
|
11
|
+
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libHalide.dylib"
|
12
|
+
IMPORTED_SONAME_RELEASE "@rpath/libHalide.dylib"
|
13
|
+
)
|
14
|
+
|
15
|
+
list(APPEND _cmake_import_check_targets Halide::Halide )
|
16
|
+
list(APPEND _cmake_import_check_files_for_Halide::Halide "${_IMPORT_PREFIX}/lib/libHalide.dylib" )
|
17
|
+
|
18
|
+
# Import target "Halide::GenGen" for configuration "Release"
|
19
|
+
set_property(TARGET Halide::GenGen APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
20
|
+
set_target_properties(Halide::GenGen PROPERTIES
|
21
|
+
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
|
22
|
+
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libHalide_GenGen.a"
|
23
|
+
)
|
24
|
+
|
25
|
+
list(APPEND _cmake_import_check_targets Halide::GenGen )
|
26
|
+
list(APPEND _cmake_import_check_files_for_Halide::GenGen "${_IMPORT_PREFIX}/lib/libHalide_GenGen.a" )
|
27
|
+
|
28
|
+
# Commands beyond this point should not need to know the version.
|
29
|
+
set(CMAKE_IMPORT_FILE_VERSION)
|
@@ -0,0 +1,154 @@
|
|
1
|
+
# Generated by CMake
|
2
|
+
|
3
|
+
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
|
4
|
+
message(FATAL_ERROR "CMake >= 2.8.0 required")
|
5
|
+
endif()
|
6
|
+
if(CMAKE_VERSION VERSION_LESS "2.8.3")
|
7
|
+
message(FATAL_ERROR "CMake >= 2.8.3 required")
|
8
|
+
endif()
|
9
|
+
cmake_policy(PUSH)
|
10
|
+
cmake_policy(VERSION 2.8.3...3.26)
|
11
|
+
#----------------------------------------------------------------
|
12
|
+
# Generated CMake target import file.
|
13
|
+
#----------------------------------------------------------------
|
14
|
+
|
15
|
+
# Commands may need to know the format version.
|
16
|
+
set(CMAKE_IMPORT_FILE_VERSION 1)
|
17
|
+
|
18
|
+
# Protect against multiple inclusion, which would fail when already imported targets are added once more.
|
19
|
+
set(_cmake_targets_defined "")
|
20
|
+
set(_cmake_targets_not_defined "")
|
21
|
+
set(_cmake_expected_targets "")
|
22
|
+
foreach(_cmake_expected_target IN ITEMS Halide::Halide Halide::Generator Halide::GenGen)
|
23
|
+
list(APPEND _cmake_expected_targets "${_cmake_expected_target}")
|
24
|
+
if(TARGET "${_cmake_expected_target}")
|
25
|
+
list(APPEND _cmake_targets_defined "${_cmake_expected_target}")
|
26
|
+
else()
|
27
|
+
list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}")
|
28
|
+
endif()
|
29
|
+
endforeach()
|
30
|
+
unset(_cmake_expected_target)
|
31
|
+
if(_cmake_targets_defined STREQUAL _cmake_expected_targets)
|
32
|
+
unset(_cmake_targets_defined)
|
33
|
+
unset(_cmake_targets_not_defined)
|
34
|
+
unset(_cmake_expected_targets)
|
35
|
+
unset(CMAKE_IMPORT_FILE_VERSION)
|
36
|
+
cmake_policy(POP)
|
37
|
+
return()
|
38
|
+
endif()
|
39
|
+
if(NOT _cmake_targets_defined STREQUAL "")
|
40
|
+
string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}")
|
41
|
+
string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}")
|
42
|
+
message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n")
|
43
|
+
endif()
|
44
|
+
unset(_cmake_targets_defined)
|
45
|
+
unset(_cmake_targets_not_defined)
|
46
|
+
unset(_cmake_expected_targets)
|
47
|
+
|
48
|
+
|
49
|
+
# Compute the installation prefix relative to this file.
|
50
|
+
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
51
|
+
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
52
|
+
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
53
|
+
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
54
|
+
if(_IMPORT_PREFIX STREQUAL "/")
|
55
|
+
set(_IMPORT_PREFIX "")
|
56
|
+
endif()
|
57
|
+
|
58
|
+
# Create imported target Halide::Halide
|
59
|
+
add_library(Halide::Halide SHARED IMPORTED)
|
60
|
+
|
61
|
+
set_target_properties(Halide::Halide PROPERTIES
|
62
|
+
COMPATIBLE_INTERFACE_BOOL "CXX_RTTI"
|
63
|
+
INTERFACE_COMPILE_DEFINITIONS "HALIDE_VERSION_MAJOR=19;HALIDE_VERSION_MINOR=0;HALIDE_VERSION_PATCH=0;HALIDE_ENABLE_RTTI;HALIDE_WITH_EXCEPTIONS"
|
64
|
+
INTERFACE_COMPILE_FEATURES "cxx_std_17"
|
65
|
+
INTERFACE_LINK_LIBRARIES "Halide::Runtime"
|
66
|
+
)
|
67
|
+
|
68
|
+
if(NOT CMAKE_VERSION VERSION_LESS "3.23.0")
|
69
|
+
target_sources(Halide::Halide
|
70
|
+
INTERFACE
|
71
|
+
FILE_SET "HEADERS"
|
72
|
+
TYPE "HEADERS"
|
73
|
+
BASE_DIRS "${_IMPORT_PREFIX}/include"
|
74
|
+
FILES "${_IMPORT_PREFIX}/include/Halide.h"
|
75
|
+
)
|
76
|
+
else()
|
77
|
+
set_property(TARGET Halide::Halide
|
78
|
+
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
79
|
+
"${_IMPORT_PREFIX}/include"
|
80
|
+
)
|
81
|
+
endif()
|
82
|
+
|
83
|
+
# Create imported target Halide::Generator
|
84
|
+
add_library(Halide::Generator INTERFACE IMPORTED)
|
85
|
+
|
86
|
+
set_target_properties(Halide::Generator PROPERTIES
|
87
|
+
INTERFACE_LINK_LIBRARIES "\$<LINK_LIBRARY:WHOLE_ARCHIVE,Halide::GenGen>"
|
88
|
+
)
|
89
|
+
|
90
|
+
# Create imported target Halide::GenGen
|
91
|
+
add_library(Halide::GenGen STATIC IMPORTED)
|
92
|
+
|
93
|
+
set_target_properties(Halide::GenGen PROPERTIES
|
94
|
+
INTERFACE_LINK_LIBRARIES "Halide::Halide"
|
95
|
+
)
|
96
|
+
|
97
|
+
if(CMAKE_VERSION VERSION_LESS 3.0.0)
|
98
|
+
message(FATAL_ERROR "This file relies on consumers using CMake 3.0.0 or greater.")
|
99
|
+
endif()
|
100
|
+
|
101
|
+
# Load information for each installed configuration.
|
102
|
+
file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/Halide-shared-targets-*.cmake")
|
103
|
+
foreach(_cmake_config_file IN LISTS _cmake_config_files)
|
104
|
+
include("${_cmake_config_file}")
|
105
|
+
endforeach()
|
106
|
+
unset(_cmake_config_file)
|
107
|
+
unset(_cmake_config_files)
|
108
|
+
|
109
|
+
# Cleanup temporary variables.
|
110
|
+
set(_IMPORT_PREFIX)
|
111
|
+
|
112
|
+
# Loop over all imported files and verify that they actually exist
|
113
|
+
foreach(_cmake_target IN LISTS _cmake_import_check_targets)
|
114
|
+
foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}")
|
115
|
+
if(NOT EXISTS "${_cmake_file}")
|
116
|
+
message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file
|
117
|
+
\"${_cmake_file}\"
|
118
|
+
but this file does not exist. Possible reasons include:
|
119
|
+
* The file was deleted, renamed, or moved to another location.
|
120
|
+
* An install or uninstall procedure did not complete successfully.
|
121
|
+
* The installation package was faulty and contained
|
122
|
+
\"${CMAKE_CURRENT_LIST_FILE}\"
|
123
|
+
but not all the files it references.
|
124
|
+
")
|
125
|
+
endif()
|
126
|
+
endforeach()
|
127
|
+
unset(_cmake_file)
|
128
|
+
unset("_cmake_import_check_files_for_${_cmake_target}")
|
129
|
+
endforeach()
|
130
|
+
unset(_cmake_target)
|
131
|
+
unset(_cmake_import_check_targets)
|
132
|
+
|
133
|
+
# Make sure the targets which have been exported in some other
|
134
|
+
# export set exist.
|
135
|
+
unset(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets)
|
136
|
+
foreach(_target "Halide::Runtime" )
|
137
|
+
if(NOT TARGET "${_target}" )
|
138
|
+
set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets "${${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets} ${_target}")
|
139
|
+
endif()
|
140
|
+
endforeach()
|
141
|
+
|
142
|
+
if(DEFINED ${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets)
|
143
|
+
if(CMAKE_FIND_PACKAGE_NAME)
|
144
|
+
set( ${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
|
145
|
+
set( ${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "The following imported targets are referenced, but are missing: ${${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets}")
|
146
|
+
else()
|
147
|
+
message(FATAL_ERROR "The following imported targets are referenced, but are missing: ${${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets}")
|
148
|
+
endif()
|
149
|
+
endif()
|
150
|
+
unset(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets)
|
151
|
+
|
152
|
+
# Commands beyond this point should not need to know the version.
|
153
|
+
set(CMAKE_IMPORT_FILE_VERSION)
|
154
|
+
cmake_policy(POP)
|