Skip to content

Commit

Permalink
[mlir][gpu][transforms] Only depend on ExecutionEngine if MLIR_ENABLE…
Browse files Browse the repository at this point in the history
…_CUDA_RUNNER is true

This fixes a compilation bug where we would try to depend on ExecutionEngine but it wasn't actually built.
  • Loading branch information
nicolasvasilache committed Jul 24, 2023
1 parent 90ecfa2 commit 68b7d3f
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions mlir/test/lib/Dialect/GPU/CMakeLists.txt
Expand Up @@ -8,7 +8,6 @@ set(LIBS
MLIRAnalysis
MLIRArithDialect
MLIRBuiltinToLLVMIRTranslation
MLIRExecutionEngine
MLIRFuncDialect
MLIRGPUDialect
MLIRGPUToGPURuntimeTransforms
Expand All @@ -35,6 +34,22 @@ set(LIBS
MLIRVectorToLLVM
)

# This is how it is defined in mlir/lib/Dialect/GPU/CMakeLists.txt
# We probably want something better project-wide
if(MLIR_ENABLE_CUDA_RUNNER)
# Enable gpu-to-cubin pass.
target_compile_definitions(MLIRGPUTestPasses
PRIVATE
MLIR_GPU_TO_CUBIN_PASS_ENABLE=1
)

set(LIBS
${LIBS}

MLIRExecutionEngine
)
endif()

add_mlir_library(MLIRGPUTestPasses
TestConvertGPUKernelToCubin.cpp
TestConvertGPUKernelToHsaco.cpp
Expand All @@ -47,13 +62,3 @@ add_mlir_library(MLIRGPUTestPasses
LINK_LIBS PUBLIC
${LIBS}
)

# This is how it is defined in mlir/lib/Dialect/GPU/CMakeLists.txt
# We probably want something better project-wide
if(MLIR_ENABLE_CUDA_RUNNER)
# Enable gpu-to-cubin pass.
target_compile_definitions(MLIRGPUTestPasses
PRIVATE
MLIR_GPU_TO_CUBIN_PASS_ENABLE=1
)
endif()

0 comments on commit 68b7d3f

Please sign in to comment.