Skip to content

Commit

Permalink
Add TARGET_OPENGLCOMPUTE (#5637)
Browse files Browse the repository at this point in the history
Inadvertently removed code for properly enabling/disabling OGLC in #5626, this restores it properly
  • Loading branch information
steven-johnson committed Jan 13, 2021
1 parent 4ed4db8 commit 6620563
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Makefile
Expand Up @@ -120,7 +120,7 @@ WITH_WEBASSEMBLY ?= $(findstring webassembly, $(LLVM_COMPONENTS))
WITH_AMDGPU ?= $(findstring amdgpu, $(LLVM_COMPONENTS))
WITH_OPENCL ?= not-empty
WITH_METAL ?= not-empty
WITH_OPENGL ?= not-empty
WITH_OPENGLCOMPUTE ?= not-empty
WITH_D3D12 ?= not-empty
WITH_INTROSPECTION ?= not-empty
WITH_EXCEPTIONS ?=
Expand Down Expand Up @@ -157,7 +157,7 @@ OPENCL_LLVM_CONFIG_LIB=$(if $(WITH_OPENCL), , )
METAL_CXX_FLAGS=$(if $(WITH_METAL), -DWITH_METAL, )
METAL_LLVM_CONFIG_LIB=$(if $(WITH_METAL), , )

OPENGL_CXX_FLAGS=$(if $(WITH_OPENGL), -DWITH_OPENGL, )
OPENGLCOMPUTE_CXX_FLAGS=$(if $(WITH_OPENGLCOMPUTE), -DWITH_OPENGLCOMPUTE, )

D3D12_CXX_FLAGS=$(if $(WITH_D3D12), -DWITH_D3D12, )
D3D12_LLVM_CONFIG_LIB=$(if $(WITH_D3D12), , )
Expand Down Expand Up @@ -205,7 +205,7 @@ CXX_FLAGS += $(AARCH64_CXX_FLAGS)
CXX_FLAGS += $(X86_CXX_FLAGS)
CXX_FLAGS += $(OPENCL_CXX_FLAGS)
CXX_FLAGS += $(METAL_CXX_FLAGS)
CXX_FLAGS += $(OPENGL_CXX_FLAGS)
CXX_FLAGS += $(OPENGLCOMPUTE_CXX_FLAGS)
CXX_FLAGS += $(D3D12_CXX_FLAGS)
CXX_FLAGS += $(MIPS_CXX_FLAGS)
CXX_FLAGS += $(POWERPC_CXX_FLAGS)
Expand Down
5 changes: 5 additions & 0 deletions src/CMakeLists.txt
Expand Up @@ -460,6 +460,11 @@ if (TARGET_D3D12COMPUTE)
target_compile_definitions(Halide PRIVATE WITH_D3D12)
endif ()

option(TARGET_OPENGLCOMPUTE "Include OpenGLCompute target" ON)
if (TARGET_OPENGLCOMPUTE)
target_compile_definitions(Halide PRIVATE WITH_OPENGLCOMPUTE)
endif ()

##
# Add autoschedulers to the build.
##
Expand Down
2 changes: 1 addition & 1 deletion src/Target.cpp
Expand Up @@ -659,7 +659,7 @@ bool Target::supported() const {
#if !defined(WITH_METAL)
bad |= has_feature(Target::Metal);
#endif
#if !defined(WITH_OPENGL)
#if !defined(WITH_OPENGLCOMPUTE)
bad |= has_feature(Target::OpenGLCompute);
#endif
#if !defined(WITH_D3D12)
Expand Down

0 comments on commit 6620563

Please sign in to comment.