Skip to content

Commit

Permalink
fix cpu build
Browse files Browse the repository at this point in the history
Signed-off-by: dchigarev <[email protected]>
  • Loading branch information
dchigarev committed Jul 31, 2024
1 parent 7d90cfb commit 716af02
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
16 changes: 11 additions & 5 deletions lib/gc/CAPI/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
set(GC_ALL_LIBS
MLIROneDNNGraph
MLIRCPURuntimeDialect
GCPasses
MLIRCPURuntimeTransforms)

if(GC_USE_GPU)
list(APPEND GC_ALL_LIBS GCGPUPasses)
endif()

add_mlir_public_c_api_library(GcCAPI
Dialects.cpp
Passes.cpp
LINK_LIBS PUBLIC
MLIROneDNNGraph
MLIRCPURuntimeDialect
GCPasses
GCGPUPasses
MLIRCPURuntimeTransforms
${GC_ALL_LIBS}
)
8 changes: 6 additions & 2 deletions lib/gc/ExecutionEngine/Driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ else()
)
endif()

set(GC_PASSES GCPasses)
if(GC_USE_GPU)
list(APPEND GC_PASSES GCGPUPasses)
endif()

add_mlir_library(GCJitWrapper
Driver.cpp

Expand All @@ -36,7 +41,6 @@ add_mlir_library(GCJitWrapper
${MLIR_LINK_COMPONENTS}
${dialect_libs}
${conversion_libs}
GCPasses
GCGPUPasses
${GC_PASSES}
)

6 changes: 3 additions & 3 deletions src/gc-opt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ set(gc_opt_libs
${dialect_libs}
${conversion_libs}
${MLIR_LINK_COMPONENTS}
GCPasses
GCGPUPasses)
GCPasses)

if(GC_USE_GPU)
add_definitions(-DGC_USE_GPU=1)
get_property(IMEX_INCLUDES GLOBAL PROPERTY IMEX_INCLUDES)
include_directories(${IMEX_INCLUDES})
list(APPEND gc_opt_libs IMEXGPUXDialect IMEXXeTileDialect IMEXRegionDialect IMEXRegionTransforms
IMEXTransforms IMEXGPUToGPUX IMEXGPUToSPIRV IMEXGPUXToLLVM IMEXXeGPUToVC IMEXXeTileToXeGPU IMEXUtil)
IMEXTransforms IMEXGPUToGPUX IMEXGPUToSPIRV IMEXGPUXToLLVM IMEXXeGPUToVC IMEXXeTileToXeGPU IMEXUtil
GCGPUPasses)
endif()
if(GC_MLIR_CXX_FLAGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GC_MLIR_CXX_FLAGS}")
Expand Down
2 changes: 2 additions & 0 deletions test/mlir/test/gc/Transforms/GPU/lit.local.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
if not config.gc_use_gpu:
config.unsupported = True

0 comments on commit 716af02

Please sign in to comment.