Alex Zinenko 4c4876c314 [mlir] Use target-specific GPU kernel attributes in lowering pipelines
Until now, the GPU translation to NVVM or ROCDL intrinsics relied on the
presence of the generic `gpu.kernel` attribute to attach additional LLVM IR
metadata to the relevant functions. This would be problematic if each dialect
were to handle the conversion of its own options, which is the intended
direction for the translation infrastructure. Introduce `nvvm.kernel` and
`rocdl.kernel` in addition to `gpu.kernel` and base translation on these new
attributes instead.

Reviewed By: herhut

Differential Revision: https://reviews.llvm.org/D96591
2021-02-12 14:09:24 +01:00

41 lines
608 B
CMake

if (MLIR_CUDA_CONVERSIONS_ENABLED)
set(NVPTX_LIBS
NVPTXCodeGen
NVPTXDesc
NVPTXInfo
)
endif()
if (MLIR_ROCM_CONVERSIONS_ENABLED)
set(AMDGPU_LIBS
AMDGPUCodeGen
AMDGPUDesc
AMDGPUInfo
)
endif()
add_mlir_conversion_library(MLIRGPUToGPURuntimeTransforms
ConvertLaunchFuncToRuntimeCalls.cpp
ConvertKernelFuncToBlob.cpp
GPUOpsLowering.cpp
DEPENDS
MLIRConversionPassIncGen
intrinsics_gen
LINK_COMPONENTS
Core
MC
${AMDGPU_LIBS}
${NVPTX_LIBS}
LINK_LIBS PUBLIC
MLIRAsyncToLLVM
MLIRGPU
MLIRIR
MLIRLLVMIR
MLIRPass
MLIRSupport
MLIRStandardToLLVM
)