-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e2e4b6e
commit 86bde55
Showing
7 changed files
with
98 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package driver | ||
|
||
import ( | ||
trace "github.com/sarchlab/mgpusim/v3/accelsim_tracing/trace" | ||
) | ||
|
||
type Benchmark struct { | ||
traceParser *trace.TraceParser | ||
TraceExecs *[]trace.TraceExecs | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package driver | ||
|
||
import ( | ||
"errors" | ||
|
||
trace "github.com/sarchlab/mgpusim/v3/accelsim_tracing/trace" | ||
) | ||
|
||
type BenchmarkBuilder struct { | ||
fromTrace bool | ||
traceDirPath string | ||
} | ||
|
||
func NewBenchmarkBuilder() *BenchmarkBuilder { | ||
return &BenchmarkBuilder{ | ||
fromTrace: false, | ||
traceDirPath: "", | ||
} | ||
} | ||
|
||
func (b *BenchmarkBuilder) WithTraceDirPath(path string) *BenchmarkBuilder { | ||
b.traceDirPath = path | ||
b.fromTrace = true | ||
return b | ||
} | ||
|
||
func (b *BenchmarkBuilder) Build() (*Benchmark, error) { | ||
if !b.fromTrace { | ||
return nil, errors.New("no trace dir path specified") | ||
} | ||
bm := &Benchmark{ | ||
traceParser: trace.NewTraceParser(b.traceDirPath), | ||
TraceExecs: nil, | ||
} | ||
bm.TraceExecs = bm.traceParser.BuildTraceExecutions() | ||
return bm, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package driver | ||
|
||
import "github.com/sarchlab/mgpusim/v3/accelsim_tracing/gpu" | ||
|
||
type DriverBuilder struct { | ||
benchmark *Benchmark | ||
gpu *gpu.GPU | ||
} | ||
|
||
func NewDriverBuilder() *DriverBuilder { | ||
return &DriverBuilder{ | ||
benchmark: nil, | ||
gpu: nil, | ||
} | ||
} | ||
|
||
func (d *DriverBuilder) WithBenchmark(b *Benchmark) *DriverBuilder { | ||
d.benchmark = b | ||
return d | ||
} | ||
|
||
func (d *DriverBuilder) WithGPU(g *gpu.GPU) *DriverBuilder { | ||
d.gpu = g | ||
return d | ||
} | ||
|
||
func (d *DriverBuilder) Build() (*Driver, error) { | ||
return &Driver{ | ||
benchmark: d.benchmark, | ||
gpu: d.gpu, | ||
}, nil | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters