From 98349922c3a3cbb921cc924ebedb5d4906800c61 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 23 Dec 2022 15:01:12 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- taichi/rhi/amdgpu/amdgpu_context.cpp | 4 ++-- taichi/rhi/amdgpu/amdgpu_context.h | 4 ++-- taichi/rhi/amdgpu/amdgpu_device.cpp | 5 +++-- taichi/rhi/amdgpu/amdgpu_driver.cpp | 4 ++-- taichi/rhi/amdgpu/amdgpu_driver.h | 5 ++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/taichi/rhi/amdgpu/amdgpu_context.cpp b/taichi/rhi/amdgpu/amdgpu_context.cpp index 6a062b49f66792..04fb173a0e73b8 100644 --- a/taichi/rhi/amdgpu/amdgpu_context.cpp +++ b/taichi/rhi/amdgpu/amdgpu_context.cpp @@ -89,5 +89,5 @@ AMDGPUContext &AMDGPUContext::get_instance() { return *context; } -} -} +} // namespace lang +} // namespace taichi diff --git a/taichi/rhi/amdgpu/amdgpu_context.h b/taichi/rhi/amdgpu/amdgpu_context.h index b5d2eed18f6872..7e182e07ea3d79 100644 --- a/taichi/rhi/amdgpu/amdgpu_context.h +++ b/taichi/rhi/amdgpu/amdgpu_context.h @@ -95,5 +95,5 @@ class AMDGPUContext { static AMDGPUContext &get_instance(); }; -} -} +} // namespace lang +} // namespace taichi diff --git a/taichi/rhi/amdgpu/amdgpu_device.cpp b/taichi/rhi/amdgpu/amdgpu_device.cpp index c1ae49c5fe5ca7..75df5cdd5a598c 100644 --- a/taichi/rhi/amdgpu/amdgpu_device.cpp +++ b/taichi/rhi/amdgpu/amdgpu_device.cpp @@ -84,7 +84,8 @@ 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; } @@ -92,7 +93,7 @@ RhiResult AmdgpuDevice::map(DeviceAllocation alloc, void **mapped_ptr) { 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(info.mapped); return; } diff --git a/taichi/rhi/amdgpu/amdgpu_driver.cpp b/taichi/rhi/amdgpu/amdgpu_driver.cpp index 6b6fb0112c69a0..ee47a481cea745 100644 --- a/taichi/rhi/amdgpu/amdgpu_driver.cpp +++ b/taichi/rhi/amdgpu/amdgpu_driver.cpp @@ -78,5 +78,5 @@ AMDGPUDriver &AMDGPUDriver::get_instance() { return get_instance_without_context(); } -} -} +} // namespace lang +} // namespace taichi diff --git a/taichi/rhi/amdgpu/amdgpu_driver.h b/taichi/rhi/amdgpu/amdgpu_driver.h index 79c47cbed05e4e..85f8fc77d00304 100644 --- a/taichi/rhi/amdgpu/amdgpu_driver.h +++ b/taichi/rhi/amdgpu/amdgpu_driver.h @@ -115,6 +115,5 @@ class AMDGPUDriver : protected AMDGPUDriverBase { // bool rocm_version_valid_{false}; }; - -} -} +} // namespace lang +} // namespace taichi