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

Function VEC_ARG2

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

Source from the content-addressed store, hash-verified

237'''.replace('STRIDED_LOOP(expr)', STRIDED_LOOP(expr)).replace('VEC_LOOP(expr)', VEC_LOOP(expr))
238
239def VEC_ARG2(expr: str) -> str:
240 return '''
241{
242 NE_REGISTER store_in = params->program[pc].ret;
243 NE_REGISTER arg1 = params->program[pc].arg1;
244 NE_REGISTER arg2 = params->program[pc].arg2;
245 BOUNDS_CHECK(store_in);
246 BOUNDS_CHECK(arg1);
247 BOUNDS_CHECK(arg2);
248
249 $DTYPE0 *dest = ($DTYPE0 *)params->registers[store_in].mem;
250 $DTYPE1 *x1 = ($DTYPE1 *)params->registers[arg1].mem;
251 npy_intp sb1 = (params->registers[arg1].kind == KIND_TEMP) ? sizeof($DTYPE1) : params->registers[arg1].stride;
252 $DTYPE2 *x2 = ($DTYPE2 *)params->registers[arg2].mem;
253 npy_intp sb2 = (params->registers[arg2].kind == KIND_TEMP) ? sizeof($DTYPE2) : params->registers[arg2].stride;
254
255 if( sb1 == sizeof($DTYPE1) && sb2 == sizeof($DTYPE2) ) { // Aligned
256 VEC_LOOP(expr)
257 return 0;
258 }
259 // Strided
260 STRIDED_LOOP(expr)
261 return 0;
262}
263'''.replace('STRIDED_LOOP(expr)', STRIDED_LOOP(expr)).replace('VEC_LOOP(expr)', VEC_LOOP(expr))
264
265
266def VEC_ARG3(expr: str) -> str:

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…