Skip to content

Commit

Permalink
For Wafer-scale GPU Heterogeneous Design Porject
Browse files Browse the repository at this point in the history
  • Loading branch information
DX990307 committed Sep 20, 2024
1 parent c72c904 commit 00ebf5b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
"program": "${workspaceFolder}/samples/fir",
"args": [
"-timing",
"-length=8192",
"-length=81920",
"-report-all",
],
},
Expand Down
9 changes: 8 additions & 1 deletion driver/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type Builder struct {
useMagicMemoryCopy bool
middlewareD2HCycles int
middlewareH2DCycles int
memorySize uint64
}

// MakeBuilder creates a driver builder with some default configuration
Expand Down Expand Up @@ -74,6 +75,12 @@ func (b Builder) WithH2DCycles(h2dCycles int) Builder {
return b
}

// WithMemorySize sets the memory size of the CPU.
func (b Builder) WithMemorySize(memorySize uint64) Builder {
b.memorySize = memorySize
return b
}

// Build creates a driver.
func (b Builder) Build(name string) *Driver {
driver := new(Driver)
Expand Down Expand Up @@ -125,7 +132,7 @@ func (b *Builder) createCPU(d *Driver) {
Type: internal.DeviceTypeCPU,
MemState: internal.NewDeviceMemoryState(d.Log2PageSize),
}
cpu.SetTotalMemSize(4 * mem.GB)
cpu.SetTotalMemSize(b.memorySize)

d.memAllocator.RegisterDevice(cpu)
d.devices = append(d.devices, cpu)
Expand Down
4 changes: 4 additions & 0 deletions driver/driver.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package driver

import (
"fmt"
"log"
"reflect"
"runtime/debug"
Expand Down Expand Up @@ -455,6 +456,9 @@ 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
}

Expand Down
6 changes: 3 additions & 3 deletions timing/cp/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 00ebf5b

Please sign in to comment.