brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · f448d35 Raw
32 lines · plain
1// RUN: mlir-opt %s --gpu-to-llvm | FileCheck %s2 3module attributes {gpu.container_module} {4 5  // CHECK-LABEL: func @matmul6  // CHECK: llvm.call @mgpuStreamCreate7  // CHECK: llvm.call @mgpuMemAlloc8  // CHECK: llvm.call @mgpuMemAlloc9  // CHECK: llvm.call @mgpuCusparseLtCreate2To4SpMat10  // CHECK: llvm.call @mgpuCreateCuSparseLtDnMat11  // CHECK: llvm.call @mgpuCuSparseLtSpMMBufferSize12  // CHECK: llvm.call @mgpuCuSparseLtSpMM13  // CHECK: llvm.call @mgpuDestroyCuSparseLtSpMat14  // CHECK: llvm.call @mgpuDestroyCuSparseLtDnMat15  // CHECK: llvm.call @mgpuStreamSynchronize16  // CHECK: llvm.call @mgpuStreamDestroy17  func.func @matmul(%arg0: index) {18    %token0 = gpu.wait async19    %mem1, %token1 = gpu.alloc async [%token0] (%arg0) : memref<?xf16>20    %mem2, %token2 = gpu.alloc async [%token1] (%arg0) : memref<?xf16>21    %spmat, %token4 = gpu.create_2to4_spmat async [%token2] {PRUNE_AND_CHECK} %arg0, %arg0, %mem1:  memref<?xf16>22    %dnmat, %token5 = gpu.create_dn_tensor async [%token4]  %mem2, %arg0, %arg0 : index, index into memref<?xf16>23    %bufferSz0, %bufferSz1, %bufferSz2, %token6 = gpu.spmm_buffer_size async [%token5] %spmat, %dnmat, %dnmat : index,index,index into f1624    %token7 = gpu.spmm async [%token6] %spmat, %dnmat, %dnmat, %mem2, %mem2, %mem2 : memref<?xf16>,memref<?xf16>,memref<?xf16> into f1625    %token8 = gpu.destroy_sp_mat async [%token7] %spmat26    %token9 = gpu.destroy_dn_tensor async [%token8] %dnmat27    gpu.wait [%token9]28    return29  }30 31}32