From 02bf564debbb7cf1af169c3c24b0cd3b261ffb58 Mon Sep 17 00:00:00 2001 From: Yuwei Sun Date: Tue, 12 Nov 2024 00:01:23 +0000 Subject: [PATCH] rename variables --- driver/builder.go | 4 ++-- driver/driver.go | 4 ---- driver/internal/memoryallocator.go | 2 -- timing/cp/builder.go | 6 +++--- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/driver/builder.go b/driver/builder.go index 62f62060..caa066fe 100644 --- a/driver/builder.go +++ b/driver/builder.go @@ -17,7 +17,7 @@ type Builder struct { useMagicMemoryCopy bool middlewareD2HCycles int middlewareH2DCycles int - memorySize uint64 + cpuMemorySize uint64 } // MakeBuilder creates a driver builder with some default configuration @@ -76,7 +76,7 @@ func (b Builder) WithH2DCycles(h2dCycles int) Builder { } // WithMemorySize sets the memory size of the CPU. -func (b Builder) WithMemorySize(memorySize uint64) Builder { +func (b Builder) WithCPUMemorySize(memorySize uint64) Builder { b.memorySize = memorySize return b } diff --git a/driver/driver.go b/driver/driver.go index 0dcf0a0f..9131f317 100644 --- a/driver/driver.go +++ b/driver/driver.go @@ -1,7 +1,6 @@ package driver import ( - "fmt" "log" "reflect" "runtime/debug" @@ -462,9 +461,6 @@ func (d *Driver) distributeWGToGPUs( panic("not all wg allocated") } - // fmt.Sprintln("total WG: %d WG Per CU %d\n", totalWGCount, wgPerCU) - fmt.Printf("total WG: %d WG Per CU %d\n", totalWGCount, wgPerCU) - return wgDist } diff --git a/driver/internal/memoryallocator.go b/driver/internal/memoryallocator.go index 83f4c909..ef947077 100644 --- a/driver/internal/memoryallocator.go +++ b/driver/internal/memoryallocator.go @@ -65,9 +65,7 @@ func (a *memoryAllocatorImpl) RegisterDevice(device *Device) { state := device.MemState state.setInitialAddress(a.totalStorageByteSize) - a.totalStorageByteSize += state.getStorageSize() - a.devices[device.ID] = device } diff --git a/timing/cp/builder.go b/timing/cp/builder.go index 99e65e1e..797a5bfb 100644 --- a/timing/cp/builder.go +++ b/timing/cp/builder.go @@ -86,9 +86,9 @@ func (b Builder) Build(name string) *CommandProcessor { tracing.CollectTrace(cp, b.visTracer) } - // if b.perfAnalyzer != nil { - // b.perfAnalyzer.RegisterComponent(cp) - // } + if b.perfAnalyzer != nil { + b.perfAnalyzer.RegisterComponent(cp) + } return cp }