Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update config and add new tests #3

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions params.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@
from enum import Enum
from multiprocessing.sharedctypes import Value

@dataclass
class LimbsContext:
limbs : int

class ConfigParam:
def __init__(self,**kwargs):
self.N = 2**16
self.limbs = 47
self.exp_img_ctxt = LimbsContext(limbs=32)
self.slot_coeff_ctxt = LimbsContext(limbs=19)
for k,v in kwargs.items():
setattr(self,k,v)


@total_ordering
class CacheStyle(Enum):
Expand Down
24 changes: 24 additions & 0 deletions tests/test_simplified_scripts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import os
import sys
from pathlib import Path
import importlib.util
import pytest

SIMPLIFIED_SCRIPTS_PATH = os.path.join( Path(__file__).parent.parent,'simplified_scripts')
sys.path.insert(0,SIMPLIFIED_SCRIPTS_PATH)

def importhelper(modulename):
spec = importlib.util.spec_from_file_location(modulename, os.path.join(SIMPLIFIED_SCRIPTS_PATH,modulename+'.py'))
module = importlib.util.module_from_spec(spec)
sys.modules[modulename] = module
spec.loader.exec_module(module)
return module

@pytest.mark.parametrize("modulename",["eval_sine_cost",
"eval_sine_cost_optimized",
"fft_cost_bsgs",
"fft_cost_hoisted_unrolled"])
def test_run_scripts(modulename):
print(f'-*- running module {modulename}')
module = importhelper(modulename)
module.main()