Skip to content

Commit b9b2fbe

Browse files
committed
adds executable c_vecextensions target
1 parent fa017ae commit b9b2fbe

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

loopy/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@
153153
from loopy.target.c import (CFamilyTarget, CTarget, ExecutableCTarget,
154154
generate_header, CWithGNULibcTarget,
155155
ExecutableCWithGNULibcTarget)
156-
from loopy.target.c_vector_extensions import CVectorExtensionsTarget
156+
from loopy.target.c_vector_extensions import (CVectorExtensionsTarget,
157+
ExecutableCVectorExtensionsTarget)
157158
from loopy.target.cuda import CudaTarget
158159
from loopy.target.opencl import OpenCLTarget
159160
from loopy.target.pyopencl import PyOpenCLTarget
@@ -301,7 +302,7 @@
301302
"TargetBase",
302303
"CFamilyTarget", "CTarget", "ExecutableCTarget", "generate_header",
303304
"CWithGNULibcTarget", "ExecutableCWithGNULibcTarget",
304-
"CVectorExtensionsTarget",
305+
"CVectorExtensionsTarget", "ExecutableCVectorExtensionsTarget",
305306
"CudaTarget", "OpenCLTarget",
306307
"PyOpenCLTarget", "ISPCTarget",
307308
"NumbaTarget", "NumbaCudaTarget",

loopy/target/c_vector_extensions.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import numpy as np
22
from pytools import memoize_method
3-
from loopy.target.c import CTarget, CASTBuilder
3+
from loopy.target.c import CTarget, CWithGNULibcASTBuilder, ExecutableCTarget
44
from loopy.types import NumpyType
55

66

@@ -115,12 +115,27 @@ def allows_non_constant_indexing_for_vec_types(self):
115115
def broadcasts_scalar_assignment_to_vec_types(self):
116116
return False
117117

118+
119+
class ExecutableCVectorExtensionsTarget(CVectorExtensionsTarget,
120+
ExecutableCTarget):
121+
def __init__(self, compiler=None, fortran_abi=False):
122+
ExecutableCTarget.__init__(self, compiler=compiler, fortran_abi=fortran_abi)
123+
124+
def get_kernel_executor_cache_key(self, *args, **kwargs):
125+
return ExecutableCTarget.get_kernel_executor_cache_key(self, *args, **kwargs)
126+
127+
def get_kernel_executor(self, t_unit, *args, **kwargs):
128+
return ExecutableCTarget.get_kernel_executor(self, t_unit, *args, **kwargs)
129+
130+
def get_host_ast_builder(self):
131+
return ExecutableCTarget.get_host_ast_builder(self)
132+
118133
# }}}
119134

120135

121136
# {{{ AST builder
122137

123-
class CVectorExtensionsASTBuilder(CASTBuilder):
138+
class CVectorExtensionsASTBuilder(CWithGNULibcASTBuilder):
124139
def add_vector_access(self, access_expr, index):
125140
return access_expr[index]
126141

0 commit comments

Comments
 (0)