brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 47be1be Raw
39 lines · plain
1// RUN: mlir-opt -split-input-file -convert-arith-to-spirv -verify-diagnostics %s | FileCheck %s2 3 4//===----------------------------------------------------------------------===//5// arith.constant dense_resource6//7// The decoding of dense_resource differs between little and big endian8// machines. At the moment only litte endian is supported.9// See https://github.com/llvm/llvm-project/issues/63469 for more infos.10//11//===----------------------------------------------------------------------===//12 13// XFAIL: target={{(s390x|sparc.*)-.*}}14 15module attributes {16  spirv.target_env = #spirv.target_env<17    #spirv.vce<v1.0, [Int8, Int16, Int64, Float16, Float64], []>, #spirv.resource_limits<>>18} {19func.func @constant_dense_resource() {20  // CHECK:    %{{.*}} = spirv.Constant dense<[0.203224242, -0.254296064, -0.365104556, -0.469196141, 0.466041982]> : tensor<5xf32> : !spirv.array<5 x f32>21  %0 = arith.constant dense_resource<dense_resource_test_5xf32> : tensor<5xf32>  22  // CHECK:    %{{.*}} = spirv.Constant dense<[1, 2]> : vector<2xi32>23  %1 = arith.constant dense_resource<dense_resource_test_2xi32> : vector<2xi32>  24  // CHECK:    %{{.*}} = spirv.Constant dense<[0.35476172, 0.351080596, -0.0795008316, 0.366843373]> : tensor<4xf32> : !spirv.array<4 x f32>25  %2 = arith.constant dense_resource<dense_resource_test_2x2xf32> : tensor<1x2x2xf32>  26  return27  }28}29// Resources are kept at end of file. New tests should be added above this.30{-#31  dialect_resources: {32    builtin: {33      dense_resource_test_2xi32: "0x400000000100000002000000",34      dense_resource_test_5xf32: "0x08000000041A503E183382BEFCEEBABE7A3AF0BE0E9DEE3E",35      dense_resource_test_2x2xf32: "0x0800000054A3B53ED6C0B33E55D1A2BDE5D2BB3E"36    }37  }38#-}39