Lines Matching refs:ctx
55 static CustomDataLayoutSpec get(MLIRContext *ctx, in get()
57 return Base::get(ctx, entries); in get()
76 static SingleQueryType get(MLIRContext *ctx) { return Base::get(ctx); } in get()
115 static TypeNoLayout get(MLIRContext *ctx) { return Base::get(ctx); } in get()
189 explicit DLTestDialect(MLIRContext *ctx) in DLTestDialect()
190 : Dialect(getDialectNamespace(), ctx, TypeID::get<DLTestDialect>()) { in DLTestDialect()
191 ctx->getOrLoadDialect<DLTIDialect>(); in DLTestDialect()
251 MLIRContext ctx(registry); in TEST() local
253 OwningOpRef<ModuleOp> module = parseSourceString<ModuleOp>(ir, &ctx); in TEST()
255 EXPECT_EQ(layout.getTypeSize(IntegerType::get(&ctx, 42)), 6u); in TEST()
256 EXPECT_EQ(layout.getTypeSize(Float16Type::get(&ctx)), 2u); in TEST()
257 EXPECT_EQ(layout.getTypeSizeInBits(IntegerType::get(&ctx, 42)), 42u); in TEST()
258 EXPECT_EQ(layout.getTypeSizeInBits(Float16Type::get(&ctx)), 16u); in TEST()
259 EXPECT_EQ(layout.getTypeABIAlignment(IntegerType::get(&ctx, 42)), 8u); in TEST()
260 EXPECT_EQ(layout.getTypeABIAlignment(Float16Type::get(&ctx)), 2u); in TEST()
261 EXPECT_EQ(layout.getTypePreferredAlignment(IntegerType::get(&ctx, 42)), 8u); in TEST()
262 EXPECT_EQ(layout.getTypePreferredAlignment(Float16Type::get(&ctx)), 2u); in TEST()
272 MLIRContext ctx(registry); in TEST() local
274 OwningOpRef<ModuleOp> module = parseSourceString<ModuleOp>(ir, &ctx); in TEST()
278 EXPECT_EQ(layout.getTypeSize(IntegerType::get(&ctx, 42)), 42u); in TEST()
279 EXPECT_EQ(layout.getTypeSize(Float16Type::get(&ctx)), 16u); in TEST()
280 EXPECT_EQ(layout.getTypeSizeInBits(IntegerType::get(&ctx, 42)), 8u * 42u); in TEST()
281 EXPECT_EQ(layout.getTypeSizeInBits(Float16Type::get(&ctx)), 8u * 16u); in TEST()
282 EXPECT_EQ(layout.getTypeABIAlignment(IntegerType::get(&ctx, 42)), 64u); in TEST()
283 EXPECT_EQ(layout.getTypeABIAlignment(Float16Type::get(&ctx)), 16u); in TEST()
284 EXPECT_EQ(layout.getTypePreferredAlignment(IntegerType::get(&ctx, 42)), 128u); in TEST()
285 EXPECT_EQ(layout.getTypePreferredAlignment(Float16Type::get(&ctx)), 32u); in TEST()
295 MLIRContext ctx(registry); in TEST() local
297 OwningOpRef<ModuleOp> module = parseSourceString<ModuleOp>(ir, &ctx); in TEST()
301 EXPECT_EQ(layout.getTypeSize(IntegerType::get(&ctx, 42)), 42u); in TEST()
302 EXPECT_EQ(layout.getTypeSize(Float16Type::get(&ctx)), 16u); in TEST()
303 EXPECT_EQ(layout.getTypeSizeInBits(IntegerType::get(&ctx, 42)), 8u * 42u); in TEST()
304 EXPECT_EQ(layout.getTypeSizeInBits(Float16Type::get(&ctx)), 8u * 16u); in TEST()
305 EXPECT_EQ(layout.getTypeABIAlignment(IntegerType::get(&ctx, 42)), 64u); in TEST()
306 EXPECT_EQ(layout.getTypeABIAlignment(Float16Type::get(&ctx)), 16u); in TEST()
307 EXPECT_EQ(layout.getTypePreferredAlignment(IntegerType::get(&ctx, 42)), 128u); in TEST()
308 EXPECT_EQ(layout.getTypePreferredAlignment(Float16Type::get(&ctx)), 32u); in TEST()
321 MLIRContext ctx(registry); in TEST() local
323 OwningOpRef<ModuleOp> module = parseSourceString<ModuleOp>(ir, &ctx); in TEST()
327 EXPECT_EQ(layout.getTypeSize(IntegerType::get(&ctx, 42)), 5u); in TEST()
328 EXPECT_EQ(layout.getTypeSize(Float16Type::get(&ctx)), 6u); in TEST()
329 EXPECT_EQ(layout.getTypeSizeInBits(IntegerType::get(&ctx, 42)), 40u); in TEST()
330 EXPECT_EQ(layout.getTypeSizeInBits(Float16Type::get(&ctx)), 48u); in TEST()
331 EXPECT_EQ(layout.getTypeABIAlignment(IntegerType::get(&ctx, 42)), 8u); in TEST()
332 EXPECT_EQ(layout.getTypeABIAlignment(Float16Type::get(&ctx)), 8u); in TEST()
333 EXPECT_EQ(layout.getTypePreferredAlignment(IntegerType::get(&ctx, 42)), 16u); in TEST()
334 EXPECT_EQ(layout.getTypePreferredAlignment(Float16Type::get(&ctx)), 16u); in TEST()
336 EXPECT_EQ(layout.getTypeSize(IntegerType::get(&ctx, 32)), 32u); in TEST()
337 EXPECT_EQ(layout.getTypeSize(Float32Type::get(&ctx)), 32u); in TEST()
338 EXPECT_EQ(layout.getTypeSizeInBits(IntegerType::get(&ctx, 32)), 256u); in TEST()
339 EXPECT_EQ(layout.getTypeSizeInBits(Float32Type::get(&ctx)), 256u); in TEST()
340 EXPECT_EQ(layout.getTypeABIAlignment(IntegerType::get(&ctx, 32)), 32u); in TEST()
341 EXPECT_EQ(layout.getTypeABIAlignment(Float32Type::get(&ctx)), 32u); in TEST()
342 EXPECT_EQ(layout.getTypePreferredAlignment(IntegerType::get(&ctx, 32)), 64u); in TEST()
343 EXPECT_EQ(layout.getTypePreferredAlignment(Float32Type::get(&ctx)), 64u); in TEST()
353 MLIRContext ctx(registry); in TEST() local
355 OwningOpRef<ModuleOp> module = parseSourceString<ModuleOp>(ir, &ctx); in TEST()
361 sum += layout.getTypeSize(SingleQueryType::get(&ctx)); in TEST()
364 sum += layout.getTypeSize(SingleQueryType::get(&ctx)); in TEST()
371 ASSERT_DEATH(second.getTypeSize(SingleQueryType::get(&ctx)), "repeated call"); in TEST()
384 MLIRContext ctx(registry); in TEST() local
386 OwningOpRef<ModuleOp> module = parseSourceString<ModuleOp>(ir, &ctx); in TEST()
392 EXPECT_EQ(layout.getTypeSize(Float16Type::get(&ctx)), 6u); in TEST()
395 op->setAttr(kAttrName, CustomDataLayoutSpec::get(&ctx, {})); in TEST()
399 ASSERT_DEATH(layout.getTypeSize(Float16Type::get(&ctx)), "no longer valid"); in TEST()
410 MLIRContext ctx(registry); in TEST() local
412 OwningOpRef<ModuleOp> module = parseSourceString<ModuleOp>(ir, &ctx); in TEST()
417 ASSERT_DEATH(layout.getTypeSize(TypeNoLayout::get(&ctx)), in TEST()
429 MLIRContext ctx(registry); in TEST() local
431 OwningOpRef<ModuleOp> module = parseSourceString<ModuleOp>(ir, &ctx); in TEST()
436 EXPECT_EQ(layout.getTypeSizeInBits(IntegerType::get(&ctx, 42)), 42u); in TEST()
437 EXPECT_EQ(layout.getTypeSizeInBits(IntegerType::get(&ctx, 32)), 32u); in TEST()
438 EXPECT_EQ(layout.getTypeSize(IntegerType::get(&ctx, 42)), 6u); in TEST()
439 EXPECT_EQ(layout.getTypeSize(IntegerType::get(&ctx, 32)), 5u); in TEST()