[PYTHON][EINSUM] Now handling reduction sizes that are not a multiple of

TK
This commit is contained in:
Philippe Tillet
2020-02-14 12:41:47 -05:00
committed by Philippe Tillet
parent fa4ec7ea65
commit 3816f2f259
5 changed files with 99 additions and 73 deletions

View File

@@ -369,7 +369,7 @@ void generator::visit_masked_load_inst(ir::masked_load_inst* x) {
((PHINode*)current_result)->addIncoming(result_then, mask_then_bb);
Value *result_false = false_values->get_value(idx);
if(result_then->getType()->isVectorTy())
result_false = builder_->CreateVectorSplat(vector_size, llvm::UndefValue::get(result_false->getType()));
result_false = builder_->CreateVectorSplat(vector_size, result_false);
((PHINode*)current_result)->addIncoming(result_false, current_bb);
}
else

View File

@@ -255,6 +255,7 @@ std::unique_ptr<driver::module> function::make_bin(ir::module &module, driver::c
if(allocation.allocated_size() > context->device()->max_shared_memory())
return std::unique_ptr<driver::module>();
barriers.run(module);
// ir::print(module, std::cout);
isel.visit(module, *llvm);
// return binary
std::unique_ptr<driver::module> res(driver::module::create(context, std::move(llvm)));