brintos

brintos / llvm-project-archived public Read only

0
0
Text · 8.6 KiB · 4c24e80 Raw
255 lines · plain
1// RUN: mlir-opt -split-input-file %s | FileCheck %s2 3 4// CHECK:      module attributes {5// CHECK-SAME:   dlti.map = #dlti.map<6// CHECK-SAME:     "magic_num" = 42 : i32,7// CHECK-SAME:     "magic_num_float" = 4.242000e+01 : f32,8// CHECK-SAME:     "magic_type" = i32,9// CHECK-SAME:     i32 = #dlti.map<"bitwidth" = 32 : i32>10// CHECK:        >} {11// CHECK:      }12module attributes {13  dlti.map = #dlti.map<"magic_num" = 42 : i32,14                       "magic_num_float" = 42.42 : f32,15                       "magic_type" = i32,16                        i32 = #dlti.map<"bitwidth" = 32 : i32>>17  } {}18 19// -----20 21// CHECK:      module attributes {22// CHECK-SAME:   dlti.map = #dlti.map<23// CHECK-SAME:     "magic_num" = 42 : i32,24// CHECK-SAME:     "magic_num_float" = 4.242000e+01 : f32,25// CHECK-SAME:     "magic_type" = i32,26// CHECK-SAME:     i32 = #dlti.map<"bitwidth" = 32 : i32>27// CHECK:        >} {28// CHECK:      }29module attributes {30  dlti.map = #dlti.map<31    #dlti.dl_entry<"magic_num", 42 : i32>,32    #dlti.dl_entry<"magic_num_float", 42.42 : f32>,33    #dlti.dl_entry<"magic_type", i32>,34    #dlti.dl_entry<i32, #dlti.map<#dlti.dl_entry<"bitwidth", 32 : i32>>>35  >} {}36 37// -----38 39// CHECK:      module attributes {40// CHECK-SAME:   dlti.map = #dlti.map<41// CHECK-SAME:     "CPU" = #dlti.map<"L1_cache_size_in_bytes" = 4096 : i32>,42// CHECK-SAME:     "GPU" = #dlti.map<"max_vector_op_width" = 128 : i32>43// CHECK-SAME:   >} {44// CHECK:      }45module attributes {46  dlti.map = #dlti.map<47    #dlti.dl_entry<"CPU", #dlti.map<48      #dlti.dl_entry<"L1_cache_size_in_bytes", 4096 : i32>>>,49    #dlti.dl_entry<"GPU", #dlti.map<50      #dlti.dl_entry<"max_vector_op_width", 128 : i32>>>51  >} {}52 53// -----54 55// CHECK:      module attributes {56// CHECK-SAME:  dlti.target_system_spec = #dlti.target_system_spec<57// CHECK-SAME:    "CPU" = #dlti.target_device_spec<58// CHECK-SAME:      "L1_cache_size_in_bytes" = 4096 : i32>,59// CHECK-SAME:    "GPU" = #dlti.target_device_spec<60// CHECK-SAME:      "max_vector_op_width" = 128 : i32>61// CHECK-SAME:  >} {62// CHECK:      }63module attributes {64  dlti.target_system_spec = #dlti.target_system_spec<65    "CPU" = #dlti.target_device_spec<66      #dlti.dl_entry<"L1_cache_size_in_bytes", 4096 : i32>>,67    "GPU" = #dlti.target_device_spec<68      #dlti.dl_entry<"max_vector_op_width", 128 : i32>>69  >} {}70 71// -----72 73// CHECK:      module attributes {74// CHECK-SAME:  dlti.target_system_spec = #dlti.target_system_spec<75// CHECK-SAME:    "CPU" = #dlti.target_device_spec<76// CHECK-SAME:      "L1_cache_size_in_bytes" = 4096 : i32>,77// CHECK-SAME:    "GPU" = #dlti.target_device_spec<78// CHECK-SAME:      "L1_cache_size_in_bytes" = 8192 : i32>79// CHECK-SAME:  >} {80// CHECK:      }81module attributes {82  dlti.target_system_spec = #dlti.target_system_spec<83    "CPU" = #dlti.target_device_spec<84      #dlti.dl_entry<"L1_cache_size_in_bytes", 4096 : i32>>,85    "GPU" = #dlti.target_device_spec<86      #dlti.dl_entry<"L1_cache_size_in_bytes", 8192 : i32>>87  >} {}88 89// -----90 91// CHECK:      module attributes {92// CHECK-SAME:   dlti.target_system_spec = #dlti.target_system_spec<93// CHECK-SAME:     "CPU" = #dlti.target_device_spec<94// CHECK-SAME:       "L1_cache_size_in_bytes" = 4096 : i64>,95// CHECK-SAME:     "GPU" = #dlti.target_device_spec<96// CHECK-SAME:       "L1_cache_size_in_bytes" = 8192 : i64>97// CHECK-SAME:   >} {98// CHECK:      }99module attributes {100  dlti.target_system_spec = #dlti.target_system_spec<101    "CPU" = #dlti.target_device_spec<102      #dlti.dl_entry<"L1_cache_size_in_bytes", 4096 : i64>>,103    "GPU" = #dlti.target_device_spec<104      #dlti.dl_entry<"L1_cache_size_in_bytes", 8192 : i64>>105  >} {}106 107// -----108 109// CHECK:      module attributes {110// CHECK-SAME:   dlti.target_system_spec = #dlti.target_system_spec<111// CHECK-SAME:     "CPU" = #dlti.target_device_spec<112// CHECK-SAME:       "max_vector_op_width" = 64 : i32>,113// CHECK-SAME:     "GPU" = #dlti.target_device_spec<114// CHECK-SAME:       "max_vector_op_width" = 128 : i32>115// CHECK-SAME:   >} {116// CHECK:      }117module attributes {118  dlti.target_system_spec = #dlti.target_system_spec<119    "CPU" = #dlti.target_device_spec<120      #dlti.dl_entry<"max_vector_op_width", 64 : i32>>,121    "GPU" = #dlti.target_device_spec<122      #dlti.dl_entry<"max_vector_op_width", 128 : i32>>123  >} {}124 125// -----126 127// CHECK:      module attributes {128// CHECK-SAME:   dlti.target_system_spec = #dlti.target_system_spec<129// CHECK-SAME:     "CPU" = #dlti.target_device_spec<130// CHECK-SAME:       "max_vector_op_width" = 64 : i64>,131// CHECK-SAME:     "GPU" = #dlti.target_device_spec<132// CHECK-SAME:       "max_vector_op_width" = 128 : i64>133// CHECK-SAME:   >} {134// CHECK:      }135module attributes {136  dlti.target_system_spec = #dlti.target_system_spec<137    "CPU" = #dlti.target_device_spec<138      #dlti.dl_entry<"max_vector_op_width", 64 : i64>>,139    "GPU" = #dlti.target_device_spec<140      #dlti.dl_entry<"max_vector_op_width", 128 : i64>>141  >} {}142 143// -----144 145// CHECK:      module attributes {146// CHECK-SAME:   dlti.target_system_spec = #dlti.target_system_spec<147// CHECK-SAME:     "CPU" = #dlti.target_device_spec<148// CHECK-SAME:       "max_vector_op_width" = 64 : i64>,149// CHECK-SAME:     "GPU" = #dlti.target_device_spec<150// CHECK-SAME:       "max_vector_op_width" = 128 : i64>151// CHECK-SAME:   >} {152// CHECK:      }153module attributes {154  dlti.target_system_spec = #dlti.target_system_spec<155    "CPU" = #dlti.target_device_spec<156      #dlti.dl_entry<"max_vector_op_width", 64 : i64>>,157    "GPU" = #dlti.target_device_spec<158      #dlti.dl_entry<"max_vector_op_width", 128 : i64>>159  >} {}160 161// -----162 163// Check values of mixed type164//165// CHECK:      module attributes {166// CHECK-SAME:   dlti.target_system_spec = #dlti.target_system_spec<167// CHECK-SAME:     "CPU" = #dlti.target_device_spec<168// CHECK-SAME:       "L1_cache_size_in_bytes" = 4096 : ui32>,169// CHECK-SAME:     "GPU" = #dlti.target_device_spec<170// CHECK-SAME:       "max_vector_op_width" = "128">171// CHECK-SAME:   >} {172// CHECK:      }173module attributes {174  dlti.target_system_spec = #dlti.target_system_spec<175    "CPU" = #dlti.target_device_spec<176      #dlti.dl_entry<"L1_cache_size_in_bytes", 4096 : ui32>>,177    "GPU" = #dlti.target_device_spec<178      #dlti.dl_entry<"max_vector_op_width", "128">>179  >} {}180 181// -----182 183// Check values of mixed type184//185// CHECK:      module attributes {186// CHECK-SAME:   dlti.target_system_spec = #dlti.target_system_spec<187// CHECK-SAME:     "CPU" = #dlti.target_device_spec<188// CHECK-SAME:       "max_vector_op_width" = 4.096000e+03 : f32>,189// CHECK-SAME:     "GPU" = #dlti.target_device_spec<190// CHECK-SAME:       "L1_cache_size_in_bytes" = "128">191// CHECK-SAME:   >} {192// CHECK:      }193module attributes {194  dlti.target_system_spec = #dlti.target_system_spec<195    "CPU" = #dlti.target_device_spec<196      #dlti.dl_entry<"max_vector_op_width", 4096.0 : f32>>,197    "GPU" = #dlti.target_device_spec<198      #dlti.dl_entry<"L1_cache_size_in_bytes", "128">>199  >} {}200 201 202// -----203 204// Check values of mixed type205//206// CHECK:      module attributes {207// CHECK-SAME:   dlti.target_system_spec = #dlti.target_system_spec<208// CHECK-SAME:     "CPU" = #dlti.target_device_spec<209// CHECK-SAME:       "vector_unit" = #dlti.map<210// CHECK-SAME:         "max_op_width" = 4.096000e+03 : f32>>,211// CHECK-SAME:     "GPU" = #dlti.target_device_spec<212// CHECK-SAME:       "L1_cache_size_in_bytes" = "128">213// CHECK-SAME:   >} {214// CHECK:      }215module attributes {216  dlti.target_system_spec = #dlti.target_system_spec<217    "CPU" = #dlti.target_device_spec<218      #dlti.dl_entry<"vector_unit", #dlti.map<219        #dlti.dl_entry<"max_op_width", 4096.0 : f32>>>>,220    "GPU" = #dlti.target_device_spec<221      #dlti.dl_entry<"L1_cache_size_in_bytes", "128">>222  >} {}223 224// -----225 226// Check values of mixed type227//228// CHECK:      module attributes {229// CHECK-SAME:   dlti.target_system_spec = #dlti.target_system_spec<230// CHECK-SAME:     "CPU" = #dlti.target_device_spec<231// CHECK-SAME:       "L1_cache_size_in_bytes" = 4096 : ui32>,232// CHECK-SAME:     "GPU" = #dlti.target_device_spec<233// CHECK-SAME:       "max_vector_op_width" = 128 : i64>234// CHECK-SAME:   >} {235// CHECK:      }236module attributes {237  dlti.target_system_spec = #dlti.target_system_spec<238    "CPU" = #dlti.target_device_spec<"L1_cache_size_in_bytes" = 4096 : ui32>,239    "GPU" = #dlti.target_device_spec<"max_vector_op_width" = 128>240  >} {}241 242// -----243 244// CHECK: "test.op_with_dlti_map"() ({245// CHECK: }) {dlti.map = #dlti.map<"dlti.unknown_id" = 42 : i64>}246"test.op_with_dlti_map"() ({247}) { dlti.map = #dlti.map<#dlti.dl_entry<"dlti.unknown_id", 42>> } : () -> ()248 249// -----250 251// CHECK: "test.op_with_dlti_map"() ({252// CHECK: }) {dlti.map = #dlti.map<i32 = 42 : i64>}253"test.op_with_dlti_map"() ({254}) { dlti.map = #dlti.map<#dlti.dl_entry<i32, 42>> } : () -> ()255