Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 23, 2022
1 parent 617af78 commit 9834992
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions taichi/rhi/amdgpu/amdgpu_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,5 @@ AMDGPUContext &AMDGPUContext::get_instance() {
return *context;
}

}
}
} // namespace lang
} // namespace taichi
4 changes: 2 additions & 2 deletions taichi/rhi/amdgpu/amdgpu_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,5 @@ class AMDGPUContext {
static AMDGPUContext &get_instance();
};

}
}
} // namespace lang
} // namespace taichi
5 changes: 3 additions & 2 deletions taichi/rhi/amdgpu/amdgpu_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,16 @@ RhiResult AmdgpuDevice::map(DeviceAllocation alloc, void **mapped_ptr) {
size_t size = info.size;
info.mapped = new char[size];
// FIXME: there should be a better way to do this...
AMDGPUDriver::get_instance().memcpy_device_to_host(info.mapped, info.ptr, size);
AMDGPUDriver::get_instance().memcpy_device_to_host(info.mapped, info.ptr,
size);
*mapped_ptr = info.mapped;
return RhiResult::success;
}

void AmdgpuDevice::unmap(DeviceAllocation alloc) {
AllocInfo &info = allocations_[alloc.alloc_id];
AMDGPUDriver::get_instance().memcpy_host_to_device(info.ptr, info.mapped,
info.size);
info.size);
delete[] static_cast<char *>(info.mapped);
return;
}
Expand Down
4 changes: 2 additions & 2 deletions taichi/rhi/amdgpu/amdgpu_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,5 @@ AMDGPUDriver &AMDGPUDriver::get_instance() {
return get_instance_without_context();
}

}
}
} // namespace lang
} // namespace taichi
5 changes: 2 additions & 3 deletions taichi/rhi/amdgpu/amdgpu_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,5 @@ class AMDGPUDriver : protected AMDGPUDriverBase {
// bool rocm_version_valid_{false};
};


}
}
} // namespace lang
} // namespace taichi

0 comments on commit 9834992

Please sign in to comment.