MCPcopy Create free account
hub / github.com/pydata/numexpr / VEC_ARG1

Function VEC_ARG1

code_generators/interp_generator.py:217–237  ·  view source on GitHub ↗
(expr: str)

Source from the content-addressed store, hash-verified

215
216
217def VEC_ARG1(expr: str) -> str:
218 return '''
219{
220 NE_REGISTER store_in = params->program[pc].ret;
221 NE_REGISTER arg1 = params->program[pc].arg1;
222 BOUNDS_CHECK(store_in);
223 BOUNDS_CHECK(arg1);
224
225 $DTYPE0 *dest = ($DTYPE0 *)params->registers[store_in].mem;
226 $DTYPE1 *x1 = ($DTYPE1 *)params->registers[arg1].mem;
227 npy_intp sb1 = (params->registers[arg1].kind == KIND_TEMP) ? sizeof($DTYPE1) : params->registers[arg1].stride;
228
229 if( sb1 == sizeof($DTYPE1) ) { // Aligned
230 VEC_LOOP(expr)
231 return 0;
232 }
233 // Strided
234 STRIDED_LOOP(expr)
235 return 0;
236}
237'''.replace('STRIDED_LOOP(expr)', STRIDED_LOOP(expr)).replace('VEC_LOOP(expr)', VEC_LOOP(expr))
238
239def VEC_ARG2(expr: str) -> str:
240 return '''

Callers

nothing calls this directly

Calls 2

STRIDED_LOOPFunction · 0.85
VEC_LOOPFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…