Module Processor.Cpu

Expresses a logical CPU/thread.

type kind =
| P_core(*

Performance cpu, faster, power hungry one

*)
| E_core(*

Energy efficient, slower, global warming aware one

*)

The kind of a Cpu.t

type t = {
id : int;(*

A monotonically increasing id

*)
kind : kind;(*

Performance or Energy Efficient

*)
smt : int;(*

The smt/thread id

*)
core : int;(*

The core id, a core can have multiple smt/threads

*)
socket : int;(*

The socked id, a socket can have multiple cores

*)
}

A logical CPU

val id : t -> int

id t is t.id

val from_smt : int -> t list -> t list

from_smt smt cpulist are all Cpu.t of cpulist of smt smt

val from_core : int -> t list -> t list

from_core core cpulist are all Cpu.t of cpulist of core core

val from_socket : int -> t list -> t list

from_socket cpulist are all Cpu.t of cpulist of socket socket

val dump : t -> unit

dump cpu Outputs the contents of Cpu.t to stdout

val make : kind:kind -> id:int -> smt:int -> core:int -> socket:int -> t

make kind id smt core socket is a constructor for Cpu.t