-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First files to refactor config of keopscore
- Loading branch information
Showing
3 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import keopscore.config | ||
|
||
# TODO | ||
|
||
class Config_new: | ||
""" | ||
Set the configuration of the library. The print_all function | ||
allows to print all the attributes of the class. They should | ||
be formatted with _print at the end of the name. | ||
""" | ||
use_cuda = True # bool | ||
use_OpenMP = None # bool | ||
base_dir_path = "" # str | ||
template_path = "" # str | ||
bindings_source_dir = "" # str | ||
keops_cache_folder = "" # str | ||
default_build_folder_name = "" # str | ||
specific_gpus = "" | ||
default_build_path = "" | ||
jit_binary = "" | ||
cxx_compiler = "" | ||
cpp_env_flags = "" | ||
compile_options = "" | ||
cpp_flags = "" | ||
disable_pragma_unrolls | ||
check_openmp_loaded | ||
load_dll | ||
show_cuda_status | ||
init_cudalibs_flag | ||
init_cudalibs | ||
show_gpu_config | ||
|
||
|
||
def __init__(self, config): | ||
|
||
# detect platform | ||
self.os = platform.system() | ||
|
||
# detect python version | ||
self.python_version = platform.python_version() | ||
|
||
self.config = config | ||
|
||
@property | ||
def use_cuda(self): | ||
|
||
return | ||
|
||
def print_all(self): | ||
""" | ||
Print all the attributes of the class | ||
:return: | ||
""" | ||
# test if all the attributes contain the string "print" and launch the function | ||
for attr in dir(self): | ||
if "print" in attr: | ||
getattr(self, attr)() | ||
|
||
|
||
if __name__ == "__main__": | ||
conf = Config_new(keopscore.config) | ||
config.print_all() | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
""" | ||
Detect the platform and set the correct path for the keops library | ||
Detect if venv is active and set the correct path for the keops library | ||
Detect if conda is active and set the correct path for the keops library | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters