[mlir][sparse][gpu] set cubin flag when building for cuda
authorAart Bik <ajcbik@google.com>
Tue, 16 May 2023 17:00:36 +0000 (10:00 -0700)
committerAart Bik <ajcbik@google.com>
Tue, 16 May 2023 17:50:22 +0000 (10:50 -0700)
Reviewed By: Peiming

Differential Revision: https://reviews.llvm.org/D150692

mlir/lib/Dialect/SparseTensor/Pipelines/CMakeLists.txt

index 234a0d8..939d748 100644 (file)
@@ -27,3 +27,11 @@ add_mlir_dialect_library(MLIRSparseTensorPipelines
   MLIRVectorToLLVM
   MLIRVectorTransforms
 )
+
+if(MLIR_ENABLE_CUDA_RUNNER)
+   # Enable gpu-to-cubin pass.
+  target_compile_definitions(obj.MLIRSparseTensorPipelines
+    PRIVATE
+    MLIR_GPU_TO_CUBIN_PASS_ENABLE=1
+  )
+endif()