Skip to content
Snippets Groups Projects

Add experimental half precison support

Merged Markus Holzer requested to merge holzer/pystencils:halfP into master
2 files
+ 4
4
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 2
2
@@ -60,7 +60,7 @@ from appdirs import user_cache_dir, user_config_dir
@@ -60,7 +60,7 @@ 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
from pystencils.backends.cbackend import generate_c, get_headers, CFunction
from pystencils.backends.cbackend import generate_c, get_headers, CFunction
from pystencils.typing import CastFunc, VectorType, VectorMemoryAccess
from pystencils.typing import BasicType, CastFunc, VectorType, VectorMemoryAccess
from pystencils.include import get_pystencils_include_path
from pystencils.include import get_pystencils_include_path
from pystencils.kernel_wrapper import KernelWrapper
from pystencils.kernel_wrapper import KernelWrapper
from pystencils.utils import atomic_file_write, recursive_dict_update
from pystencils.utils import atomic_file_write, recursive_dict_update
@@ -522,7 +522,7 @@ class ExtensionModuleCode:
@@ -522,7 +522,7 @@ class ExtensionModuleCode:
half = False
half = False
for ast in self._ast_nodes:
for ast in self._ast_nodes:
for field in ast.fields_accessed:
for field in ast.fields_accessed:
if field.dtype.base_type is None and field.dtype.is_half():
if isinstance(field.dtype, BasicType) and field.dtype.is_half():
half = True
half = True
headers.update(get_headers(ast))
headers.update(get_headers(ast))
if half:
if half:
Loading