From 66654dfa89cd2bc33fd0ac226973d191eba614c8 Mon Sep 17 00:00:00 2001 From: Sibylau Date: Fri, 5 Jan 2024 23:35:59 -0500 Subject: [PATCH] script --- .../CPU/UniSparse/sparlay_bdia_csr_spmv.mlir | 164 ++++++++++++++++++ .../UniSparse/unisparse_bdia_csr_spmv.mlir | 119 +++++++++++++ .../UniSparse/executables/coo_cisr | Bin 0 -> 19208 bytes .../UniSparse/executables/coo_cisr.o | Bin 0 -> 6056 bytes ...o_to_cisr.mlir => unisparse_coo_cisr.mlir} | 7 - evaluation/FormatConversion/coo_cisr.o | Bin 0 -> 496 bytes evaluation/FormatConversion/run.sh | 5 + 7 files changed, 288 insertions(+), 7 deletions(-) create mode 100644 evaluation/CPU/UniSparse/sparlay_bdia_csr_spmv.mlir create mode 100644 evaluation/CPU/UniSparse/unisparse_bdia_csr_spmv.mlir create mode 100755 evaluation/FormatConversion/UniSparse/executables/coo_cisr create mode 100644 evaluation/FormatConversion/UniSparse/executables/coo_cisr.o rename evaluation/FormatConversion/UniSparse/{temp_coo_to_cisr.mlir => unisparse_coo_cisr.mlir} (75%) create mode 100644 evaluation/FormatConversion/coo_cisr.o diff --git a/evaluation/CPU/UniSparse/sparlay_bdia_csr_spmv.mlir b/evaluation/CPU/UniSparse/sparlay_bdia_csr_spmv.mlir new file mode 100644 index 0000000..06f1be2 --- /dev/null +++ b/evaluation/CPU/UniSparse/sparlay_bdia_csr_spmv.mlir @@ -0,0 +1,164 @@ +// sparlay-opt ./decompose-BDIA.mlir -lower-struct-convert -lower-struct -dce -sparlay-codegen -lower-format-conversion | \ +// mlir-opt -one-shot-bufferize="bufferize-function-boundaries=1 allow-return-allocs unknown-type-conversion=identity-layout-map function-boundary-type-conversion=identity-layout-map" \ +// -finalizing-bufferize -convert-linalg-to-loops -convert-vector-to-scf -convert-scf-to-cf -lower-affine \ +// -convert-vector-to-llvm -convert-memref-to-llvm -convert-complex-to-standard -convert-math-to-llvm \ +// -convert-math-to-libm -convert-complex-to-libm -convert-complex-to-llvm -convert-func-to-llvm \ +// -reconcile-unrealized-casts | mlir-translate -mlir-to-llvmir | opt -O3 -S | llc -O3 -relocation-model=pic -filetype=obj -o bdia_spmv.o + +// clang++ bdia_spmv.o -L$SPLHOME/build/lib -lmlir_sparlay_runner_utils \ +// -L$LLVMHOME/build/lib -lmlir_runner_utils -lmlir_c_runner_utils -o bdia_spmv + +// ./bdia_spmv + +// RUN: sparlay-opt %s -lower-struct-convert -lower-struct -dce -lower-format-conversion | FileCheck %s + + +!Filename = !llvm.ptr + +#COO = #sparlay.encoding<{ + crdMap = #sparlay.crd<(i,j)->(i,j)>, + compressMap = #sparlay.compress +}> + +#CSR = #sparlay.encoding<{ + crdMap = #sparlay.crd<(i,j)->(i,j)>, + compressMap = #sparlay.compress +}> + +#BDIA = #sparlay.encoding<{ + crdMap = #sparlay.crd<(i,j)->(i floordiv 50, j minus i, i mod 50)>, + compressMap = #sparlay.compress +}> + +#trait1 = { +indexing_maps = [ + affine_map<(i,j) -> (i, j)>, // A + affine_map<(i,j) -> (j)>, // B + affine_map<(i,j) -> (i)> // X (out) + ], + iterator_types = ["parallel", "reduction"], + doc = "X(i) =+ A(i,j) * B(j)" +} + +module { + func.func private @rtclock() -> f64 + func.func private @getTensorFilename(index) -> (!Filename) + func.func @kernel_csr_spmv(%arg0: tensor, %arg1: tensor, %argx: tensor) -> tensor { + %0 = linalg.generic #trait1 + ins(%arg0, %arg1 : tensor, tensor) + outs(%argx: tensor) { + ^bb0(%a: f32, %b: f32, %x: f32): + %2 = arith.mulf %a, %b : f32 + %3 = arith.addf %x, %2 : f32 + linalg.yield %3 : f32 + } -> tensor + return %0 : tensor + } + + func.func @main() { + %c0 = arith.constant 0: index + %c1 = arith.constant 1 : index + %f0 = arith.constant 0.0: f32 + %f05 = arith.constant 0.5: f32 + %i1 = arith.constant 1: i32 + %blockSize = arith.constant 100: i32 + %thres_1 = arith.constant 0.5: f32 + + %fileName = call @getTensorFilename(%c0) : (index) -> (!Filename) + %A_1 = sparlay.fromFile (%fileName): !llvm.ptr to tensor + %dim1 = tensor.dim %A_1, %c1 : tensor + %dim0 = tensor.dim %A_1, %c0 : tensor + // %thres_1 = arith.constant dense<[0.5]>: tensor<1xf32> + // %thres_2 = bufferization.alloc_tensor () copy(%thres_1): tensor<1xf32> + // %thres = bufferization.to_memref %thres_2: memref<1xf32> + + %t_start0 = call @rtclock() : () -> f64 + %S_1 = sparlay.decompose_BDIA %A_1, %blockSize, %thres_1 : tensor, i32, f32 to + !sparlay.struct< tensor, tensor > + %t_end0 = call @rtclock() : () -> f64 + %t_0 = arith.subf %t_end0, %t_start0: f64 + vector.print %t_0 : f64 + + %B_0 = sparlay.struct_access %S_1[0]: + !sparlay.struct< tensor, tensor > + to tensor + %B_1 = sparlay.struct_access %S_1[1]: + !sparlay.struct< tensor, tensor > + to tensor + + %D_0 = sparlay.convert(%B_0) : tensor to tensor + + // %init_256_4 = bufferization.alloc_tensor(%dim1) : tensor + // %b = scf.for %i = %c0 to %dim1 step %c1 iter_args(%t = %init_256_4) -> tensor { + // %k0 = arith.muli %i, %c1 : index + // %k1 = arith.index_cast %k0 : index to i32 + // %k = arith.sitofp %k1 : i32 to f32 + // %t3 = tensor.insert %k into %t[%i] : tensor + // scf.yield %t3 : tensor + // } + %init_256_4 = bufferization.alloc_tensor(%dim1) : tensor + // %tensor_B = tensor.insert %f05 into %init_256_4[%c0] : tensor + // %dim1_1 = arith.subi %dim1, %c1 : index + // %i_dim1_1 = arith.index_cast %dim1_1 : index to i32 + // %f_dim1_1 = arith.sitofp %i_dim1_1 : i32 to f32 + // %elm = arith.divf %f05, %f_dim1_1 : f32 + // %b = scf.for %i = %c1 to %dim1 step %c1 iter_args(%t = %tensor_B) -> tensor { + %b = scf.for %i = %c0 to %dim1 step %c1 iter_args(%t = %init_256_4) -> tensor { + %k1 = arith.index_cast %i : index to i32 + %k = arith.sitofp %k1 : i32 to f32 + %t3 = tensor.insert %k into %t[%i] : tensor + scf.yield %t3 : tensor + } + + // %o0 = bufferization.alloc_tensor(%dim0) : tensor + // %o00 = scf.for %i = %c0 to %dim0 step %c1 iter_args(%t = %o0) -> tensor { + // %t3 = tensor.insert %f0 into %t[%i] : tensor + // scf.yield %t3 : tensor + // } + %o1 = bufferization.alloc_tensor(%dim0) : tensor + %o11 = scf.for %i = %c0 to %dim0 step %c1 iter_args(%t = %o1) -> tensor { + %t3 = tensor.insert %f0 into %t[%i] : tensor + scf.yield %t3 : tensor + } + // %o2 = bufferization.alloc_tensor(%dim0) : tensor + // %o22 = scf.for %i = %c0 to %dim0 step %c1 iter_args(%t = %o2) -> tensor { + // %t3 = tensor.insert %f0 into %t[%i] : tensor + // scf.yield %t3 : tensor + // } + + %t_start4 = call @rtclock() : () -> f64 + // CSR SpMV + // %result0 = call @kernel_csr_spmv(%D_0, %b, %o00) : (tensor, tensor, tensor) -> tensor + // %t_end1 = call @rtclock() : () -> f64 + // block DIA SpMV + %result1 = sparlay.bdia_spmv %D_0, %B_1, %b, %o1: + tensor, tensor, tensor, tensor to memref + // %t_end2 = call @rtclock() : () -> f64 + // %output = linalg.elemwise_binary ins(%result0, %result1: tensor, tensor) + // outs(%o2: tensor) -> tensor + %t_end4 = call @rtclock() : () -> f64 + // %t_1 = arith.subf %t_end1, %t_start4: f64 + // %t_2 = arith.subf %t_end2, %t_end1: f64 + // %t_4 = arith.subf %t_end4, %t_end2: f64 + %t_5 = arith.subf %t_end4, %t_start4: f64 + // vector.print %t_1 : f64 + // vector.print %t_2 : f64 + // vector.print %t_4 : f64 + vector.print %t_5 : f64 + // %v0 = vector.transfer_read %result0[%c0], %f0: tensor, vector<4xf32> + // vector.print %v0 : vector<4xf32> + %v1 = vector.transfer_read %result1[%c0], %f0: memref, vector<4xf32> + vector.print %v1 : vector<4xf32> + // %v2 = vector.transfer_read %output[%c0], %f0: tensor, vector<4xf32> + // vector.print %v2 : vector<4xf32> + bufferization.dealloc_tensor %A_1 : tensor + bufferization.dealloc_tensor %B_1 : tensor + sparlay.release %S_1: !sparlay.struct< tensor, tensor > + // bufferization.dealloc_tensor %B_0 : tensor + // bufferization.dealloc_tensor %o1 : tensor + // bufferization.dealloc_tensor %result0 : tensor + // bufferization.dealloc_tensor %output : tensor + + return + } +} \ No newline at end of file diff --git a/evaluation/CPU/UniSparse/unisparse_bdia_csr_spmv.mlir b/evaluation/CPU/UniSparse/unisparse_bdia_csr_spmv.mlir new file mode 100644 index 0000000..c13b076 --- /dev/null +++ b/evaluation/CPU/UniSparse/unisparse_bdia_csr_spmv.mlir @@ -0,0 +1,119 @@ +// sparlay-opt ./decompose-BDIA.mlir -lower-struct-convert -lower-struct -dce -sparlay-codegen -lower-format-conversion | \ +// mlir-opt -one-shot-bufferize="bufferize-function-boundaries=1 allow-return-allocs unknown-type-conversion=identity-layout-map function-boundary-type-conversion=identity-layout-map" \ +// -finalizing-bufferize -convert-linalg-to-loops -convert-vector-to-scf -convert-scf-to-cf -lower-affine \ +// -convert-vector-to-llvm -convert-memref-to-llvm -convert-complex-to-standard -convert-math-to-llvm \ +// -convert-math-to-libm -convert-complex-to-libm -convert-complex-to-llvm -convert-func-to-llvm \ +// -reconcile-unrealized-casts | mlir-translate -mlir-to-llvmir | opt -O3 -S | llc -O3 -relocation-model=pic -filetype=obj -o bdia_spmv.o + +// clang++ bdia_spmv.o -L$SPLHOME/build/lib -lmlir_sparlay_runner_utils \ +// -L$LLVMHOME/build/lib -lmlir_runner_utils -lmlir_c_runner_utils -o bdia_spmv + +// ./bdia_spmv + +// RUN: sparlay-opt %s -lower-struct-convert -lower-struct -dce -lower-format-conversion | FileCheck %s + + +!Filename = !llvm.ptr + +#COO = #sparlay.encoding<{ + crdMap = #sparlay.crd<(i,j)->(i,j)>, + compressMap = #sparlay.compress +}> + +#CSR = #sparlay.encoding<{ + crdMap = #sparlay.crd<(i,j)->(i,j)>, + compressMap = #sparlay.compress +}> + +#BDIA = #sparlay.encoding<{ + crdMap = #sparlay.crd<(i,j)->(i floordiv 50, j minus i, i mod 50)>, + compressMap = #sparlay.compress +}> + +#trait1 = { +indexing_maps = [ + affine_map<(i,j) -> (i, j)>, // A + affine_map<(i,j) -> (j)>, // B + affine_map<(i,j) -> (i)> // X (out) + ], + iterator_types = ["parallel", "reduction"], + doc = "X(i) =+ A(i,j) * B(j)" +} + +module { + func.func private @rtclock() -> f64 + func.func private @getTensorFilename(index) -> (!Filename) + func.func @kernel_csr_spmv(%arg0: tensor, %arg1: tensor, %argx: tensor) -> tensor { + %0 = linalg.generic #trait1 + ins(%arg0, %arg1 : tensor, tensor) + outs(%argx: tensor) { + ^bb0(%a: f32, %b: f32, %x: f32): + %2 = arith.mulf %a, %b : f32 + %3 = arith.addf %x, %2 : f32 + linalg.yield %3 : f32 + } -> tensor + return %0 : tensor + } + + func.func @main() { + %c0 = arith.constant 0: index + %c1 = arith.constant 1 : index + %f0 = arith.constant 0.0: f32 + %f05 = arith.constant 0.5: f32 + %i1 = arith.constant 1: i32 + %blockSize = arith.constant 100: i32 + %thres_1 = arith.constant 0.3: f32 + + %fileName = call @getTensorFilename(%c0) : (index) -> (!Filename) + %A_1 = sparlay.fromFile (%fileName): !llvm.ptr to tensor + %dim1 = tensor.dim %A_1, %c1 : tensor + %dim0 = tensor.dim %A_1, %c0 : tensor + + %t_start0 = call @rtclock() : () -> f64 + %S_1 = sparlay.decompose_BDIA %A_1, %blockSize, %thres_1 : tensor, i32, f32 to + !sparlay.struct< tensor, tensor > + %t_end0 = call @rtclock() : () -> f64 + %t_0 = arith.subf %t_end0, %t_start0: f64 + vector.print %t_0 : f64 + + %B_0 = sparlay.struct_access %S_1[0]: + !sparlay.struct< tensor, tensor > + to tensor + %B_1 = sparlay.struct_access %S_1[1]: + !sparlay.struct< tensor, tensor > + to tensor + + %D_0 = sparlay.convert(%B_0) : tensor to tensor + + %init_256_4 = bufferization.alloc_tensor(%dim1) : tensor + %b = scf.for %i = %c0 to %dim1 step %c1 iter_args(%t = %init_256_4) -> tensor { + %k1 = arith.index_cast %i : index to i32 + %k = arith.sitofp %k1 : i32 to f32 + %t3 = tensor.insert %k into %t[%i] : tensor + scf.yield %t3 : tensor + } + + %o1 = bufferization.alloc_tensor(%dim0) : tensor + %o11 = scf.for %i = %c0 to %dim0 step %c1 iter_args(%t = %o1) -> tensor { + %t3 = tensor.insert %f0 into %t[%i] : tensor + scf.yield %t3 : tensor + } + + %t_start4 = call @rtclock() : () -> f64 + // block DIA SpMV + %result1 = sparlay.bdia_spmv %D_0, %B_1, %b, %o1: + tensor, tensor, tensor, tensor to memref + outs(%o2: tensor) -> tensor + %t_end4 = call @rtclock() : () -> f64 + %t_5 = arith.subf %t_end4, %t_start4: f64 + vector.print %t_5 : f64 + + %v1 = vector.transfer_read %result1[%c0], %f0: memref, vector<4xf32> + vector.print %v1 : vector<4xf32> + bufferization.dealloc_tensor %A_1 : tensor + bufferization.dealloc_tensor %B_1 : tensor + sparlay.release %S_1: !sparlay.struct< tensor, tensor > + + return + } +} \ No newline at end of file diff --git a/evaluation/FormatConversion/UniSparse/executables/coo_cisr b/evaluation/FormatConversion/UniSparse/executables/coo_cisr new file mode 100755 index 0000000000000000000000000000000000000000..4cd2236eddbc9e516327abc79678437928be7dfe GIT binary patch literal 19208 zcmeHPeQ;dWb-z!$E6b9-l57(T40wZ0D+5|dw(R;Nj(7FtRggfjWo);=^J@25+IqFC z?7lTJ=_E=`7%9d<(@BDdFd3#_At{s63}t9L(;7@EQ>IK{Qp$ufbu&PugeI;5*A0g4 z@7#CK>h0COmT6|%fA-G2J@@?XIp^Mc-hKDuy?ghIeS`fqh9Nlk#HR&up=Jk(sDxOz zihxAKcF};}4dMn-3*Ij=Cq3d2q&i`|rkvI(+y_c}kEwK>UaRDoatVo&o>!P!?xZjk zO%6|b0g5VKr+-TYLSV}2rTjuN8ICEZ+g16Qy7kC6Gi{Fi%77w} zXOte(h{}&C`;&Y^*K;aery-ifwzh3u;e0l{S=O8ElkDEx4v@GYw<=ST zr}%1IB;%C(OA;rH!pqi66Hcu1?_Wc4RfVL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9qW0$e=I0cu?nq%qgXgqBu?QAY@ z#tTy-k)4=KTeg)9Z|~UFSy_lq(xuFJE*C#xS{XZcLLANEke-<=OiY}Bii7_z7caI+CA83mY*M7dc4rIl5sokc@lHrb{rPOwAaM6I_cP==TA)7 z@ljAa=g@JE;Y6yHn-t+p*0#dY?twNtJ|@CrnL>Cxo*x(Cp4>PZ?;!U%JYs`E%W8XQLs@rhId z*=KFCjKWc)4&!!-FrMoPJgdO0(ZZNHSs0~rwMcOIROV=wT27c8*GgNe8nEN<^*GEkCnJUS;!v-+)YK`@I9mO={7DimXb}XTth+V=vIo9X* zluS1&N!F_?X*!WzAha}ReO{L_J+BH(;{iokzXfp$J-FyyAnWt`jVZqeC0Po3{ci;5I%aq^ak_=|AOZ@kFVB{0LcX0x*Hx<=aKv=f5a`o_J7}zE^3d;8MH%gOkZNB(SQt4ID(^-mb3enHt`JvK`` zKf8<(J*4z!R0H@Vu+6x*J@EKP-`BY9AX*CN=?ekE1}#y~pI#ejB2v#6l|=Mu3K}c^ E3kjf6aR2}S literal 0 HcmV?d00001 diff --git a/evaluation/FormatConversion/UniSparse/executables/coo_cisr.o b/evaluation/FormatConversion/UniSparse/executables/coo_cisr.o new file mode 100644 index 0000000000000000000000000000000000000000..dcdc17db892a8a15933a2987a0193bacd4236416 GIT binary patch literal 6056 zcmc(jYiv|S6vyXwyGv?}#?eJ?y}V|J&}`vT>mE z>IEdzJN}hZt{wkU)ZX!v4!YFXR6D>^W z8n@TZubO@1f3ffR-a}v1J>2z(Ga^=#b!WIG7zjsZ%nHB1YG#ww98#(#s-VPMv*AE^ zX~VLHl{1wJ2<)UGuZ^l|U0Z`v!6=0?Zwbv&oh`uI8U`D-l9xI|Nm6G>>YUlEadh+N zE~=~41gX~ADlS$qAgWt2gM1A%?|O8VZZfY zO`oReGc~x(UIrrR~v-IA+#cbfwh*_hmeej!fEHMNwCe*`vGJV<3@aZG)XFB<%vMOd^$4Z&IG_ zRQ|`28-$>PqayX99O(+Tc7@vx1)iy?IRZ7ZDqM%Ef9a}Khw0a{tiQukQBb$B z=UcITxx(&PaV$}=lQEjHLNS&fOU8Dk7cIGWp;KARCr0g9f8W{-LrM1$jFqz~qJ^Rz zv-c*_(O zR5!~CgA%CjLk5>wy9Sg0q-z0N0o8aN-$V&FYwb$JHN^2;nv!9EsT2QUAO9!Wzl{Tl z|9&6;nzWBegz{P$e!@L8lw{LeJ5_xFs(_5NbMAc(Jz=LLtlTp!OX zJ{T~ zE_IkY2)M+AjX8pd{|wi3a)63-EAIl*?*Sw+`4Sgb;*7Ap+=q8FmpHOUwi>*R?Og`% zU>oZWB5~r5r7G)O_yF@`TuOhlY`^Nm-(oIthS~nW@ZZn&hd%ss<`O5*_F01;WLut3 z$&(Hsj{M4{$+3SzgtxnFMS$o>g~zs|gDaGCFMgP&r5yk{XOkmorV zB<~vhM;EJ82LFw@tXYgd_6QL_-o_4S6PL(hR)j~`?lpKD+uIG^!L~fV5+~05u;D+z z_6r6dX8X9oCGMvNKgjmC2A^R2SuSOq*;Fc;v`5N2hY}+r1$(cG7VLB)TC(?-Saoaj z<&n~Xyj?V5Hjx2zorQDh)GCY=JuiMVz&PZRT9hdV^(p!!uQMfgH%ZSV&i@3 zm4BS`zsQalKm3O#_sh5*C1&P?TQ2g4tNF)(>H9SKdbQty21%qHm{@CO`*) func.func private @sptCheckF32(!llvm.ptr, !llvm.ptr) attributes {llvm.emit_c_interface} func.func private @sptMoveF32(!llvm.ptr, i32, i32) -> !llvm.ptr attributes {llvm.emit_c_interface} - func.func private @sptSwapF32(!llvm.ptr, i32, i32) -> !llvm.ptr attributes {llvm.emit_c_interface} - func.func private @sptTileSplitF32(!llvm.ptr, i32, i32) -> !llvm.ptr attributes {llvm.emit_c_interface} - func.func private @sptSeparateF32(!llvm.ptr, i32) -> !llvm.ptr attributes {llvm.emit_c_interface} - func.func private @sptTrimF32(!llvm.ptr, i32) -> !llvm.ptr attributes {llvm.emit_c_interface} - func.func private @sptGrowF32(!llvm.ptr, i32) -> !llvm.ptr attributes {llvm.emit_c_interface} func.func private @sptFuseF32(!llvm.ptr, i32) -> !llvm.ptr attributes {llvm.emit_c_interface} func.func private @sptSumF32(!llvm.ptr, i32) -> !llvm.ptr attributes {llvm.emit_c_interface} - func.func private @sptEnumerateF32(!llvm.ptr, i32, i32) -> !llvm.ptr attributes {llvm.emit_c_interface} func.func private @sptScheduleF32(!llvm.ptr, i32, i32, i32) -> !llvm.ptr attributes {llvm.emit_c_interface} func.func private @sptPadF32(!llvm.ptr, i32, i32) -> !llvm.ptr attributes {llvm.emit_c_interface} func.func private @sptReorderF32(!llvm.ptr, i32, i32) -> !llvm.ptr attributes {llvm.emit_c_interface} - func.func private @sptCustTrimF32(!llvm.ptr, i32) -> !llvm.ptr attributes {llvm.emit_c_interface} func.func private @sptCopyF32(!llvm.ptr) -> !llvm.ptr attributes {llvm.emit_c_interface} func.func private @sptFromFileF32(!llvm.ptr) -> !llvm.ptr attributes {llvm.emit_c_interface} func.func private @rtclock() -> f64 diff --git a/evaluation/FormatConversion/coo_cisr.o b/evaluation/FormatConversion/coo_cisr.o new file mode 100644 index 0000000000000000000000000000000000000000..af87ee95eeca1fb7c4b8f20e9d287463c7525d30 GIT binary patch literal 496 zcmb<-^>JfjWMqH=Mg}_u1P><4z_0Lk|lOAB5S^)H$H>VO$m%14^?4X>>C|QVt*j3qV(E2voy_MV$jw%m7M* N^nuiIK=~3-8UO}68WI2i literal 0 HcmV?d00001 diff --git a/evaluation/FormatConversion/run.sh b/evaluation/FormatConversion/run.sh index 3379a48..db8bd93 100644 --- a/evaluation/FormatConversion/run.sh +++ b/evaluation/FormatConversion/run.sh @@ -19,6 +19,8 @@ mlir-opt ./UniSparse/unisparse_csb_dia_v.mlir -one-shot-bufferize="bufferize-fun clang++ csb_dia_v.o -L$SPLHOME/build/lib -lmlir_unisparse_runner_utils -L$LLVM_ROOT/build/lib -lmlir_runner_utils -lmlir_c_runner_utils -o csb_dia_v mlir-opt ./UniSparse/unisparse_coo_c2sr.mlir -one-shot-bufferize="bufferize-function-boundaries=1 allow-return-allocs unknown-type-conversion=identity-layout-map function-boundary-type-conversion=identity-layout-map" -finalizing-bufferize -convert-linalg-to-loops -convert-vector-to-scf -convert-scf-to-cf -lower-affine -convert-vector-to-llvm -convert-memref-to-llvm -convert-complex-to-standard -convert-math-to-llvm -convert-math-to-libm -convert-complex-to-libm -convert-complex-to-llvm -convert-func-to-llvm -reconcile-unrealized-casts | mlir-translate -mlir-to-llvmir | opt -O3 -S | llc -O3 -relocation-model=pic -filetype=obj -o coo_c2sr.o clang++ coo_c2sr.o -L$SPLHOME/build/lib -lmlir_unisparse_runner_utils -L$LLVM_ROOT/build/lib -lmlir_runner_utils -lmlir_c_runner_utils -o coo_c2sr +mlir-opt ./UniSparse/unisparse_coo_cisr.mlir -one-shot-bufferize="bufferize-function-boundaries=1 allow-return-allocs unknown-type-conversion=identity-layout-map function-boundary-type-conversion=identity-layout-map" -finalizing-bufferize -convert-linalg-to-loops -convert-vector-to-scf -convert-scf-to-cf -lower-affine -convert-vector-to-llvm -convert-memref-to-llvm -convert-complex-to-standard -convert-math-to-llvm -convert-math-to-libm -convert-complex-to-libm -convert-complex-to-llvm -convert-func-to-llvm -reconcile-unrealized-casts | mlir-translate -mlir-to-llvmir | opt -O3 -S | llc -O3 -relocation-model=pic -filetype=obj -o coo_cisr.o +clang++ coo_cisr.o -L$SPLHOME/build/lib -lmlir_unisparse_runner_utils -L$LLVM_ROOT/build/lib -lmlir_runner_utils -lmlir_c_runner_utils -o coo_cisr mlir-opt ./sparse_tensor_dialect/sparse_tensor_csr_to_csc.mlir -sparse-compiler | mlir-translate -mlir-to-llvmir | opt -O3 -S | llc -O3 -relocation-model=pic -filetype=obj -o sparse_tensor_csr_csc.o clang++ sparse_tensor_csr_csc.o -L$LLVM_ROOT/build/lib -lmlir_runner_utils -lmlir_c_runner_utils -o sparse_tensor_csr_csc @@ -56,4 +58,7 @@ do echo COO_C2SR UniSparse ./coo_c2sr + + echo COO_CISR UniSparse + ./coo_cisr done \ No newline at end of file