Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
echuraev committed Feb 1, 2023
1 parent a35988f commit e7a6ab7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/runtime/opencl/opencl_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,13 @@ PackedFunc OpenCLModuleNode::GetFunction(const std::string& name,
const ObjectPtr<Object>& sptr_to_self) {
ICHECK_EQ(sptr_to_self.get(), this);
if (name == "__GetPreCompiledPrograms") {
return PackedFunc(
[sptr_to_self, this](TVMArgs args, TVMRetValue* rv) { *rv = this->GetPreCompiledPrograms(); });
return PackedFunc([sptr_to_self, this](TVMArgs args, TVMRetValue* rv) {
*rv = this->GetPreCompiledPrograms();
});
} else if (name == "__SetPreCompiledPrograms") {
return PackedFunc(
[sptr_to_self, this](TVMArgs args, TVMRetValue* rv) { this->SetPreCompiledPrograms(args[0]); });
return PackedFunc([sptr_to_self, this](TVMArgs args, TVMRetValue* rv) {
this->SetPreCompiledPrograms(args[0]);
});
}
ICHECK_NE(name, symbol::tvm_module_main) << "Device function do not have main";
auto it = fmap_.find(name);
Expand Down Expand Up @@ -315,7 +317,8 @@ std::string OpenCLModuleNode::GetPreCompiledPrograms() {
dmlc::MemoryStringStream writer(&data);
dmlc::Stream* strm = &writer;
strm->Write(static_cast<uint64_t>(parsed_kernels_.size()));
for (auto& [name, source] : parsed_kernels_) {
for (auto& it : parsed_kernels_) {
std::string name = it.first;
cl::OpenCLThreadEntry* t = workspace_->GetThreadEntry();
int device_id = t->device.device_id;
t->kernel_table.resize(workspace_->num_registered_kernels);
Expand Down

0 comments on commit e7a6ab7

Please sign in to comment.