Commit 8c6703e6 authored by Noric Couderc's avatar Noric Couderc
Browse files

Removed counter parameter for CostFeature

We might want the CostFeature to have the feature we aggregate, but
I used to print "cyclesInsertions", so it makes more sense to me to
constrain it to cycles.
parent 51054de2
......@@ -66,7 +66,9 @@ class ConstantFeature(val name : String, val value : Double) : Feature() {
/** This is a feature where we measure the number of cycles
* for some class of operations on the collection
*/
class CostFeature(val opType : OperationType, val counter : PAPICounter) : Feature() {
class CostFeature(val opType : OperationType) : Feature() {
val counter = PAPICounter("PAPI_TOT_CYC")
override fun featureType(): Type {
return Type.HARDWARE
}
......@@ -157,7 +159,6 @@ class FeatureSet(val features : List<Feature>) {
}
fun brainyFeatures() : FeatureSet {
val totCycles = PAPICounter("PAPI_TOT_CYC")
return FeatureSet(
se.lth.cs.listOf(PAPICounter("PAPI_BR_MSP"),
PAPICounter("PAPI_L1_DCM"),
......@@ -175,8 +176,8 @@ fun brainyFeatures() : FeatureSet {
PAPICounter("PAPI_BR_MSP"),
PAPICounter("PAPI_BR_CN")
),
CostFeature(OperationType.SEARCH, totCycles),
CostFeature(OperationType.ITERATE, totCycles),
CostFeature(OperationType.INSERT, totCycles),
CostFeature(OperationType.DELETE, totCycles)))
CostFeature(OperationType.SEARCH),
CostFeature(OperationType.ITERATE),
CostFeature(OperationType.INSERT),
CostFeature(OperationType.DELETE)))
}
......@@ -45,7 +45,7 @@ class EventSetBuilderTest {
@Test
fun testEventBuilderCost() {
val features = listOf(
CostFeature(OperationType.INSERT, PAPICounter("PAPI_TOT_CYC")),
CostFeature(OperationType.INSERT),
PAPICounter("PAPI_L1_DCM")
)
......@@ -72,8 +72,8 @@ class EventSetBuilderTest {
PAPICounter("PAPI_L2_DCA")
),
FeatureRatio(
CostFeature(OperationType.INSERT, PAPICounter("PAPI_TOT_CYC")),
CostFeature(OperationType.DELETE, PAPICounter("PAPI_TOT_CYC"))
CostFeature(OperationType.INSERT),
CostFeature(OperationType.DELETE)
)
)
......
......@@ -54,9 +54,7 @@ class ExperimentTest {
PAPICounter("PAPI_L2_DCA")
)
val costPerDelete = CostFeature(
OperationType.DELETE,
PAPICounter("PAPI_TOT_CYC"))
val costPerDelete = CostFeature(OperationType.DELETE)
val exp = Experiment(10, bench,
FeatureSet(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment