add_subdirectory(Math)
add_subdirectory(MemRef)
add_subdirectory(NVGPU)
-add_subdirectory(NVVM)
add_subdirectory(SCF)
add_subdirectory(Shape)
add_subdirectory(SPIRV)
# Exclude tests from libMLIR.so
-add_mlir_library(MLIRGPUTestPasses
- TestConvertGPUKernelToCubin.cpp
- TestConvertGPUKernelToHsaco.cpp
- TestGpuMemoryPromotion.cpp
- TestGpuRewrite.cpp
+get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS)
- EXCLUDE_FROM_LIBMLIR
+set(LIBS
+ ${conversion_libs}
- LINK_LIBS PUBLIC
MLIRAffineDialect
+ MLIRAnalysis
+ MLIRArithDialect
+ MLIRBuiltinToLLVMIRTranslation
+ MLIRExecutionEngine
MLIRFuncDialect
MLIRGPUDialect
MLIRGPUToGPURuntimeTransforms
+ MLIRGPUTransforms
+ MLIRIR
+ MLIRLLVMDialect
+ MLIRLLVMCommonConversion
MLIRLLVMToLLVMIRTranslation
+ MLIRToLLVMIRTranslationRegistration
+ MLIRMemRefDialect
+ MLIRMemRefToLLVM
MLIRNVVMDialect
MLIRNVVMToLLVMIRTranslation
MLIRPass
MLIRROCDLDialect
MLIRROCDLToLLVMIRTranslation
MLIRSCFDialect
+ MLIRSupport
+ MLIRTargetLLVMIRExport
+ MLIRTransforms
MLIRTransformUtils
+ MLIRTranslateLib
+ MLIRVectorDialect
+ MLIRVectorToLLVM
+ )
+
+add_mlir_library(MLIRGPUTestPasses
+ TestConvertGPUKernelToCubin.cpp
+ TestConvertGPUKernelToHsaco.cpp
+ TestGpuMemoryPromotion.cpp
+ TestGpuRewrite.cpp
+ TestLowerToNVVM.cpp
+
+ EXCLUDE_FROM_LIBMLIR
+
+ LINK_LIBS PUBLIC
+ ${LIBS}
)
using namespace mlir;
+#if MLIR_CUDA_CONVERSIONS_ENABLED
namespace {
struct TestLowerToNVVMOptions
: public PassPipelineOptions<TestLowerToNVVMOptions> {
// Finally we can reconcile unrealized casts.
pm.addNestedPass<gpu::GPUModuleOp>(createReconcileUnrealizedCastsPass());
+
+#if MLIR_GPU_TO_CUBIN_PASS_ENABLE
pm.addNestedPass<gpu::GPUModuleOp>(createGpuSerializeToCubinPass(
options.cubinTriple, options.cubinChip, options.cubinFeatures));
+#endif // MLIR_GPU_TO_CUBIN_PASS_ENABLE
}
void buildLowerToNVVMPassPipeline(OpPassManager &pm,
}
} // namespace test
} // namespace mlir
+#endif // MLIR_CUDA_CONVERSIONS_ENABLED
+++ /dev/null
-if (MLIR_ENABLE_CUDA_RUNNER)
- # Configure CUDA support. Using check_language first allows us to give a
- # custom error message.
- include(CheckLanguage)
- check_language(CUDA)
- if (CMAKE_CUDA_COMPILER)
- enable_language(CUDA)
- else()
- message(SEND_ERROR
- "Building the mlir cuda runner requires a working CUDA install")
- endif()
-
- # We need the libcuda.so library.
- find_library(CUDA_RUNTIME_LIBRARY cuda HINTS ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES} REQUIRED)
-
- get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS)
- set(LIBS
- ${conversion_libs}
-
- MLIRAnalysis
- MLIRArithDialect
- MLIRBuiltinToLLVMIRTranslation
- MLIRExecutionEngine
- MLIRFuncDialect
- MLIRGPUDialect
- MLIRIR
- MLIRJitRunner
- MLIRLLVMDialect
- MLIRLLVMCommonConversion
- MLIRLLVMToLLVMIRTranslation
- MLIRToLLVMIRTranslationRegistration
- MLIRMemRefDialect
- MLIRMemRefToLLVM
- MLIRParser
- MLIRSPIRVDialect
- MLIRSPIRVTransforms
- MLIRSupport
- MLIRTargetLLVMIRExport
- MLIRTransforms
- MLIRTranslateLib
- MLIRVectorDialect
- MLIRVectorToLLVM
- )
-
- # Exclude tests from libMLIR.so
- add_mlir_library(MLIRNVVMTestPasses
- TestLowerToNVVM.cpp
-
- EXCLUDE_FROM_LIBMLIR
-
- LINK_LIBS PUBLIC
- ${LIBS}
- )
-endif()