Commit 026d93ca authored by Noric Couderc's avatar Noric Couderc
Browse files

Refactoring: Divided ConstantFeature in two classes

Some features are about hardware, some are about software. So you need
separate classes to print data with the right types
parent 728c6b0f
......@@ -48,11 +48,8 @@ abstract class Feature {
* Constant features are usually machine-specific,
* like cache block size!
*/
class ConstantFeature(val name : String, val value : Double) : Feature() {
override fun featureType(): Type {
// HAHA, this depends!
TODO("Not yet implemented")
}
abstract class ConstantFeature(val name : String, val value : Double) : Feature() {
abstract override fun featureType(): Type
override fun accept(visitor: FeatureVisitor) {
visitor.visitConstant(this)
......@@ -65,6 +62,21 @@ class ConstantFeature(val name : String, val value : Double) : Feature() {
}
/** Hardware and Software constant features
*
*/
class HardwareConstantFeature(name : String, value : Double) : ConstantFeature(name, value) {
override fun featureType(): Type {
return Type.HARDWARE
}
}
class SoftwareConstantFeature(name : String, value : Double) : ConstantFeature(name, value) {
override fun featureType(): Type {
return Type.SOFTWARE
}
}
/** This is a feature where we measure the number of cycles
* for some class of operations on the collection
*/
......@@ -181,10 +193,10 @@ fun brainyFeatures() : FeatureSet {
PAPICounter("PAPI_L1_DCA")
),
FeatureRatio(
ConstantFeature("Data Size", Integer.BYTES.toDouble()),
SoftwareConstantFeature("Data Size", Integer.BYTES.toDouble()),
// Type "getconf -a | grep "CACHE" to find this.
// TODO: Make this automatic
ConstantFeature("Cache Block Size", 64.0)
HardwareConstantFeature("Cache Block Size", 64.0)
),
FeatureRatio(
PAPICounter("PAPI_BR_MSP"),
......
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