|
1 | 1 | import numpy as np |
2 | 2 | from pytools import memoize_method |
3 | | -from loopy.target.c import CTarget, CASTBuilder |
| 3 | +from loopy.target.c import CTarget, CWithGNULibcASTBuilder, ExecutableCTarget |
4 | 4 | from loopy.types import NumpyType |
5 | 5 |
|
6 | 6 |
|
@@ -115,12 +115,27 @@ def allows_non_constant_indexing_for_vec_types(self): |
115 | 115 | def broadcasts_scalar_assignment_to_vec_types(self): |
116 | 116 | return False |
117 | 117 |
|
| 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 | + |
118 | 133 | # }}} |
119 | 134 |
|
120 | 135 |
|
121 | 136 | # {{{ AST builder |
122 | 137 |
|
123 | | -class CVectorExtensionsASTBuilder(CASTBuilder): |
| 138 | +class CVectorExtensionsASTBuilder(CWithGNULibcASTBuilder): |
124 | 139 | def add_vector_access(self, access_expr, index): |
125 | 140 | return access_expr[index] |
126 | 141 |
|
|
0 commit comments