Skip to content
Snippets Groups Projects

Add experimental half precison support

Merged Markus Holzer requested to merge holzer/pystencils:halfP into master
1 file
+ 5
6
Compare changes
  • Side-by-side
  • Inline
+ 5
6
@@ -43,20 +43,21 @@ Then 'cl.exe' is used to compile.
@@ -43,20 +43,21 @@ Then 'cl.exe' is used to compile.
For Windows compilers the qualifier should be ``__restrict``
For Windows compilers the qualifier should be ``__restrict``
"""
"""
 
from appdirs import user_cache_dir, user_config_dir
 
from collections import OrderedDict
import hashlib
import hashlib
import json
import json
import os
import os
import platform
import platform
import shutil
import shutil
import subprocess
import subprocess
import textwrap
import warnings
from collections import OrderedDict
from sysconfig import get_paths
from sysconfig import get_paths
from tempfile import TemporaryDirectory, NamedTemporaryFile
from tempfile import TemporaryDirectory, NamedTemporaryFile
 
import textwrap
 
import time
 
import warnings
import numpy as np
import numpy as np
from appdirs import user_cache_dir, user_config_dir
from pystencils import FieldType
from pystencils import FieldType
from pystencils.astnodes import LoopOverCoordinate
from pystencils.astnodes import LoopOverCoordinate
@@ -477,8 +478,6 @@ def load_kernel_from_file(module_name, function_name, path):
@@ -477,8 +478,6 @@ def load_kernel_from_file(module_name, function_name, path):
mod = module_from_spec(spec)
mod = module_from_spec(spec)
spec.loader.exec_module(mod)
spec.loader.exec_module(mod)
except ImportError:
except ImportError:
import time
import warnings
warnings.warn(f"Could not load {path}, trying on more time in 5 seconds ...")
warnings.warn(f"Could not load {path}, trying on more time in 5 seconds ...")
time.sleep(5)
time.sleep(5)
spec = spec_from_file_location(name=module_name, location=path)
spec = spec_from_file_location(name=module_name, location=path)
Loading