1 //===- MemoryPromotion.h - Utilities for moving data across GPU -*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // This header file declares the utility functions that generate IR copying 10 // the data between different levels of memory hierarchy. 11 // 12 //===----------------------------------------------------------------------===// 13 14 #ifndef MLIR_DIALECT_GPU_MEMORYPROMOTION_H 15 #define MLIR_DIALECT_GPU_MEMORYPROMOTION_H 16 17 namespace mlir { 18 19 namespace gpu { 20 class GPUFuncOp; 21 } 22 23 /// Promotes a function argument to workgroup memory in the given function. The 24 /// copies will be inserted in the beginning and in the end of the function. 25 void promoteToWorkgroupMemory(gpu::GPUFuncOp op, unsigned arg); 26 27 } // end namespace mlir 28 29 #endif // MLIR_DIALECT_GPU_MEMORYPROMOTION_H 30