8000 Fix subsetted build issues with arm32/64, hexagon. by alexreinking · Pull Request #5745 · halide/Halide · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix subsetted build issues with arm32/64, hexagon. #5745

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/CodeGen_Hexagon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2336,6 +2336,7 @@ std::unique_ptr<CodeGen_Posix> new_CodeGen_Hexagon(const Target &target, llvm::L

std::unique_ptr<CodeGen_Posix> new_CodeGen_Hexagon(const Target &target, llvm::LLVMContext &context) {
user_error << "hexagon not enabled for this build of Halide.\n";
return nullptr;
}

#endif // WITH_HEXAGON
Expand Down
55 changes: 39 additions & 16 deletions src/LLVM_Runtime_Linker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,17 @@ std::unique_ptr<llvm::Module> parse_bitcode_file(llvm::StringRef buf, llvm::LLVM
return parse_bitcode_file(sb, context, #mod); \
}

#define DECLARE_NO_INITMOD(mod) \
std::unique_ptr<llvm::Module> get_initmod_##mod(llvm::LLVMContext *, bool, bool) { \
user_error << "Halide was compiled without support for this target\n"; \
return std::unique_ptr<llvm::Module>(); \
} \
std::unique_ptr<llvm::Module> get_initmod_##mod##_ll(llvm::LLVMContext *) { \
user_error << "Halide was compiled without support for this target\n"; \
return std::unique_ptr<llvm::Module>(); \
#define DECLARE_NO_INITMOD(mod) \
std::unique_ptr<llvm::Module> get_initmod_##mod(llvm::LLVMContext *, bool = false, bool = false) { \
user_error << "Halide was compiled without support for this target\n"; \
return std::unique_ptr<llvm::Module>(); \
} \
std::unique_ptr<llvm::Module> get_initmod_##mod##_ll(llvm::LLVMContext *) { \
user_error << "Halide was compiled without support for this target\n"; \
return std::unique_ptr<llvm::Module>(); \
}

#define DECLARE_CPP_INITMOD(mod) \
DECLARE_INITMOD(mod##_32_debug) \
DECLARE_INITMOD(mod##_64_debug) \
DECLARE_INITMOD(mod##_32) \
DECLARE_INITMOD(mod##_64) \
#define DECLARE_CPP_INITMOD_LOOKUP(mod) \
std::unique_ptr<llvm::Module> get_initmod_##mod(llvm::LLVMContext *context, bool bits_64, bool debug) { \
if (bits_64) { \
if (debug) { \
Expand All @@ -67,6 +63,13 @@ std::unique_ptr<llvm::Module> parse_bitcode_file(llvm::StringRef buf, llvm::LLVM
} \
}

#define DECLARE_CPP_INITMOD(mod) \
DECLARE_INITMOD(mod##_32_debug) \
DECLARE_INITMOD(mod##_64_debug) \
DECLARE_INITMOD(mod##_32) \
DECLARE_INITMOD(mod##_64) \
DECLARE_CPP_INITMOD_LOOKUP(mod)

#define DECLARE_LL_INITMOD(mod) \
DECLARE_INITMOD(mod##_ll)

Expand Down Expand Up @@ -198,14 +201,34 @@ DECLARE_LL_INITMOD(ptx_compute_30)
DECLARE_LL_INITMOD(ptx_compute_35)
#endif // WITH_NVPTX

#ifdef WITH_D3D12
#if defined(WITH_D3D12) && defined(WITH_X86)
DECLARE_CPP_INITMOD(windows_d3d12compute_x86)
DECLARE_CPP_INITMOD(windows_d3d12compute_arm)
#else
DECLARE_NO_INITMOD(windows_d3d12compute_x86)
DECLARE_NO_INITMOD(windows_d3d12compute_arm)
#endif

#ifdef WITH_D3D12
#ifdef WITH_ARM
DECLARE_INITMOD(windows_d3d12compute_arm_32)
DECLARE_INITMOD(windows_d3d12compute_arm_32_debug)
#else
DECLARE_NO_INITMOD(windows_d3d12compute_arm_32)
DECLARE_NO_INITMOD(windows_d3d12compute_arm_32_debug)
#endif

#ifdef WITH_AARCH64
DECLARE_INITMOD(windows_d3d12compute_arm_64)
DECLARE_INITMOD(windows_d3d12compute_arm_64_debug)
#else
DECLARE_NO_INITMOD(windows_d3d12compute_arm_64)
DECLARE_NO_INITMOD(windows_d3d12compute_arm_64_debug)
#endif

DECLARE_CPP_INITMOD_LOOKUP(windows_d3d12compute_arm)
#else
DECLARE_NO_INITMOD(windows_d3d12compute_arm)
#endif // WITH_D3D12

#ifdef WITH_X86
DECLARE_LL_INITMOD(x86_avx512)
DECLARE_LL_INITMOD(x86_avx2)
Expand Down
6 changes: 4 additions & 2 deletions src/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,12 @@ foreach (i IN LISTS RUNTIME_CPP)
endif ()
# Windows on ARM
elseif (i MATCHES "windows_.*_arm$")
if (j EQUAL 32)
if (j EQUAL 32 AND TARGET_ARM)
set(TARGET "arm-unknown-windows-unknown")
else ()
elseif (j EQUAL 64 AND TARGET_AARCH64)
set(TARGET "aarch64-unknown-windows-unknown")
else ()
continue()
endif ()
# Windows Generic
else()
Expand Down
0