This is an archive of the discontinued LLVM Phabricator instance.

Ignore MLIRGPUtoCUDATransforms in the MLIRTestTransforms library when the NVPTX target is disabled
AbandonedPublic

Authored by psamolysov on May 28 2020, 1:43 AM.

Details

Summary

When the NVPTX target is enabled, MLIR provides the MLIRGPUtoCUDATransforms conversion library and the MLIRTestTransforms test library as well as the MLIRMlirOptMain one depend on this transform. If a local LLVM build with enabled NVPTX is installed, the information about the libraries and their dependencies is stored into a generated lib\cmake\mlir\MLIRTargets.cmake file.

But when NVPTX is disabled and LLVM is build without NVPTX (only with X86 for example), the MLIRGPUtoCUDATransforms conversion library is not created and there is no information about the library in the generated lib\cmake\mlir\MLIRTargets.cmake file. Regardless this fact, the MLIRTestTransforms still depends on the conversion library and the MLIRTargets.cmake file contains the following line:

set_target_properties(MLIRTestTransforms PROPERTIES
  INTERFACE_LINK_LIBRARIES "MLIRAffineOps;MLIRAnalysis;MLIREDSC;MLIRGPU;MLIRGPUtoCUDATransforms;...
)

The patch wraps MLIRGPUtoCUDATransforms into a condition: MLIRTestTransforms depends on the library iff MLIR_CUDA_CONVERSIONS_ENABLED is true.

Diff Detail

Unit TestsFailed

Event Timeline

psamolysov created this revision.May 28 2020, 1:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 28 2020, 1:43 AM

I believe this fail is not related to MLIR

This pass was refactored in D80142, could you please update this accordingly?

@ftynse Thank you for your comment. As I see, ROCM and CUDA support has been merged into the MLIRGPUtoGPURuntimeTransforms library and when I have neither CUDA nor AMDGPU, the library still be built but without being linked with the CUDA and/or AMDGPU targets. So, I see I'm a bit late and my patch is not required :)

Thanks anyway!

ftynse resigned from this revision.May 29 2020, 9:19 AM
psamolysov abandoned this revision.Apr 30 2022, 4:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 30 2022, 4:02 AM