Tests a computation consisting of a single scalar constant node.
| 338 | |
| 339 | // Tests a computation consisting of a single scalar constant node. |
| 340 | TEST_F(BufferAssignmentTest, ScalarConstant) { |
| 341 | auto builder = HloComputation::Builder(TestName()); |
| 342 | auto const0 = builder.AddInstruction( |
| 343 | HloInstruction::CreateConstant(LiteralUtil::CreateR0<float>(1.0))); |
| 344 | auto module = CreateNewVerifiedModule(); |
| 345 | module->AddEntryComputation(builder.Build()); |
| 346 | |
| 347 | { |
| 348 | auto buffers = RunBufferAssignment(module.get()); |
| 349 | EXPECT_TRUE(buffers->HasTopLevelAllocation(const0)); |
| 350 | } |
| 351 | |
| 352 | { |
| 353 | auto buffers = RunBufferAssignmentNoBuffersForConstants(module.get()); |
| 354 | EXPECT_FALSE(buffers->HasTopLevelAllocation(const0)); |
| 355 | } |
| 356 | } |
| 357 | |
| 358 | TEST_F(BufferAssignmentTest, BufferForConst) { |
| 359 | // Addition of two vector constants: checks that internal constant nodes have |
nothing calls this directly
no test coverage detected