MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / builtin_sort_cblock

Function builtin_sort_cblock

include/daScript/simulate/aot.h:3419–3436  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3417
3418 template <typename TT>
3419 void builtin_sort_cblock ( vec4f arr, int32_t, int32_t length, const TBlock<bool,TT,TT> & cmp, Context * context, LineInfoArg * lineinfo ) {
3420 auto data = cast<TT *>::to(arr);
3421 if ( cmp.jitFunction ) {
3422 using CmpFn = CallJitFn<bool, TT, TT, const Block &, Context*>;
3423 das_sort ( data, data+length, [&](TT x, TT y) -> bool {
3424 return CmpFn::static_call(cmp.jitFunction,x,y,cmp,context);
3425 });
3426 } else {
3427 vec4f bargs[2];
3428 context->invokeEx(cmp, bargs, nullptr, [&](SimNode * code) {
3429 das_sort ( data, data+length, [&](TT x, TT y) -> bool {
3430 bargs[0] = cast<TT>::from(x);
3431 bargs[1] = cast<TT>::from(y);
3432 return code->evalBool(*context);
3433 });
3434 },lineinfo);
3435 }
3436 }
3437
3438 template <typename CompareFn, typename TT>
3439 struct scblk_array;

Callers

nothing calls this directly

Calls 4

toFunction · 0.85
das_sortFunction · 0.85
invokeExMethod · 0.80
evalBoolMethod · 0.45

Tested by

no test coverage detected