API Reference
Epochly API Reference: Enhancement Level Enum
EnhancementLevel enum reference: MONITORING, THREADING, JIT, MULTICORE, GPU values and usage.
The EnhancementLevel enum defines the available optimization levels.
Definition
from epochly.core.epochly_core import EnhancementLevelclass EnhancementLevel(IntEnum):LEVEL_0_MONITOR = 0 # Monitoring onlyLEVEL_1_THREADING = 1 # Threading optimizationLEVEL_2_JIT = 2 # JIT compilationLEVEL_3_FULL = 3 # Full optimization with sub-interpretersLEVEL_4_GPU = 4 # GPU acceleration
Level Details
| Level | Name | Description |
|---|---|---|
| 0 | LEVEL_0_MONITOR | Performance monitoring without optimization |
| 1 | LEVEL_1_THREADING | Threading-based optimization for I/O-bound tasks |
| 2 | LEVEL_2_JIT | JIT compilation for numerical code |
| 3 | LEVEL_3_FULL | Full optimization with sub-interpreters for CPU-bound tasks |
| 4 | LEVEL_4_GPU | GPU acceleration for supported operations |
Usage
With Decorator
from epochly import optimizefrom epochly.core.epochly_core import EnhancementLevel@optimize(level=EnhancementLevel.LEVEL_2_JIT)def my_function(data):return process(data)
With set_level
import epochlyepochly.set_level(3) # Set to LEVEL_3_FULL
Comparison
from epochly.core.epochly_core import EnhancementLevellevel = epochly.get_level()if level >= EnhancementLevel.LEVEL_2_JIT:print("JIT compilation enabled")