[selection/codegen] bugfix in distributed tile indices initialization
This commit is contained in:
@@ -29,7 +29,8 @@ void distributed_tile::init_indices() {
|
|||||||
indices_t current;
|
indices_t current;
|
||||||
for(size_t d = 0; d < id.size(); d++)
|
for(size_t d = 0; d < id.size(); d++)
|
||||||
current.push_back(axes_[d].values[id[d]]);
|
current.push_back(axes_[d].values[id[d]]);
|
||||||
indices_[current] = indices_.size();
|
size_t sz = indices_.size();
|
||||||
|
indices_[current] = sz;
|
||||||
values_[current] = UndefValue::get(ty_);
|
values_[current] = UndefValue::get(ty_);
|
||||||
ordered_indices_.push_back(current);
|
ordered_indices_.push_back(current);
|
||||||
id[0]++;
|
id[0]++;
|
||||||
@@ -840,10 +841,6 @@ void selection::lower_tile_instruction(ir::instruction *ins, llvm::IRBuilder<> &
|
|||||||
unsigned id = linear / vector_size;
|
unsigned id = linear / vector_size;
|
||||||
if(linear % vector_size == 0)
|
if(linear % vector_size == 0)
|
||||||
packets[id] = result->get_value(idx);
|
packets[id] = result->get_value(idx);
|
||||||
});
|
|
||||||
in->for_each([&](indices_t idx){
|
|
||||||
unsigned linear = in->get_linear_index(idx);
|
|
||||||
unsigned id = linear / vector_size;
|
|
||||||
packets[id] = builder.CreateInsertElement(packets.at(id), in->get_value(idx), linear % vector_size);
|
packets[id] = builder.CreateInsertElement(packets.at(id), in->get_value(idx), linear % vector_size);
|
||||||
});
|
});
|
||||||
result->for_each([&](indices_t idx){
|
result->for_each([&](indices_t idx){
|
||||||
|
@@ -243,10 +243,12 @@ std::string cu_module::compile_llvm_module(llvm::Module* module) {
|
|||||||
layout += "-i64:64-i128:128-v16:16-v32:32-n16:32:64";
|
layout += "-i64:64-i128:128-v16:16-v32:32-n16:32:64";
|
||||||
// create
|
// create
|
||||||
llvm::SmallVector<char, 0> buffer;
|
llvm::SmallVector<char, 0> buffer;
|
||||||
module::compile_llvm_module(module, "nvptx64-nvidia-cuda", "sm_75", layout, buffer, "", Assembly);
|
module::compile_llvm_module(module, "nvptx64-nvidia-cuda", "sm_70", layout, buffer, "", Assembly);
|
||||||
std::string result(buffer.begin(), buffer.end());
|
std::string result(buffer.begin(), buffer.end());
|
||||||
std::string to_replace = ".version 6.3";
|
size_t start_replace = result.find(".version");
|
||||||
result.replace(result.find(to_replace), to_replace.size(), ".version 6.4");
|
size_t end_replace = result.find('\n', start_replace);
|
||||||
|
assert(start_replace != std::string::npos);
|
||||||
|
result.replace(start_replace, end_replace - start_replace, ".version 6.4");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user