MLIR 22.0.0git
NVGPU.cpp
Go to the documentation of this file.
1//===- NVGPU.cpp - C Interface for NVGPU dialect ------------------===//
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
13
14using namespace mlir;
15using namespace mlir::nvgpu;
16
17MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(NVGPU, nvgpu, mlir::nvgpu::NVGPUDialect)
18
20 return isa<nvgpu::TensorMapDescriptorType>(unwrap(type));
21}
22
23MlirType mlirNVGPUTensorMapDescriptorTypeGet(MlirContext ctx,
24 MlirType tensorMemrefType,
25 int swizzle, int l2promo,
26 int oobFill, int interleave) {
27 return wrap(nvgpu::TensorMapDescriptorType::get(
28 unwrap(ctx), cast<MemRefType>(unwrap(tensorMemrefType)),
29 TensorMapSwizzleKind(swizzle), TensorMapL2PromoKind(l2promo),
30 TensorMapOOBKind(oobFill), TensorMapInterleaveKind(interleave)));
31}
MlirType mlirNVGPUTensorMapDescriptorTypeGet(MlirContext ctx, MlirType tensorMemrefType, int swizzle, int l2promo, int oobFill, int interleave)
Definition NVGPU.cpp:23
MLIR_CAPI_EXPORTED bool mlirTypeIsANVGPUTensorMapDescriptorType(MlirType type)
Definition NVGPU.cpp:19
#define MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(Name, Namespace, ClassName)
MlirDiagnostic wrap(mlir::Diagnostic &diagnostic)
Definition Diagnostics.h:24
mlir::Diagnostic & unwrap(MlirDiagnostic diagnostic)
Definition Diagnostics.h:19
Include the generated interface declarations.