ConvertLaunchFuncToCudaCalls: use LLVM dialect globals
authorAlex Zinenko <zinenko@google.com>
Tue, 20 Aug 2019 14:51:32 +0000 (07:51 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Tue, 20 Aug 2019 14:52:01 +0000 (07:52 -0700)
commit006fcce44a2560c9a12e82c99a494971e5b1d7be
tree5223695487ee10a2e10dc38318b765e34336d315
parent0d82a292b0ddcee9737ac2a1234bedd3b149b7f1
ConvertLaunchFuncToCudaCalls: use LLVM dialect globals

This conversion has been using a stack-allocated array of i8 to store the
null-terminated kernel name in order to pass it to the CUDA wrappers expecting
a C string because the LLVM dialect was missing support for globals.  Now that
the suport is introduced, use a global instead.

Refactor global string construction from GenerateCubinAccessors into a common
utility function living in the LLVM namespace.

PiperOrigin-RevId: 264382489
mlir/include/mlir/Conversion/GPUToCUDA/GPUToCUDAPass.h
mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h
mlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp
mlir/lib/Conversion/GPUToCUDA/GenerateCubinAccessors.cpp
mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
mlir/test/Conversion/GPUToCUDA/lower-launch-func-to-cuda.mlir