internal static unsafe JobHandle ScheduleXO <T>(this T jobData,
                                                        BurstTensorData pinX,
                                                        FencedMemoryAlloc pinO,
                                                        int arrayLength, int innerloopBatchCount,
                                                        FencingHelperMode fencingMode = FencingHelperMode.UpdateResourcesFencesOnScheduling)
            where T : struct, IJobParallelFor, BurstCPUOps.IJobResourceDeclarationXO
        {
            var fenceBeforeJobStart = GetFenceBeforeJobStartXO(pinX, pinO);

            JobHandle jobFence;

            fixed(float *
                  ptrX = &pinX.array[pinX.offset])
            {
                var ptrO = pinO.data;

                jobFence = ScheduleXOInternal(jobData, fenceBeforeJobStart, ptrX, ptrO, arrayLength, innerloopBatchCount);
            }

            if (fencingMode == FencingHelperMode.UpdateResourcesFencesOnScheduling)
            {
                jobFence.SetXOFences(pinX, pinO);
            }

            return(jobFence);
        }
        internal static unsafe JobHandle ScheduleXSBO <T>(this T jobData,
                                                          BurstTensorData pinX,
                                                          FencedMemoryAlloc pinS,
                                                          FencedMemoryAlloc pinB,
                                                          BurstTensorData pinO,
                                                          int arrayLength, int innerloopBatchCount,
                                                          FencingHelperMode fencingMode = FencingHelperMode.UpdateResourcesFencesOnScheduling)
            where T : struct, IJobParallelFor, BurstCPUOps.IJobResourceDeclarationXSBO
        {
            var fenceBeforeJobStart = GetFenceBeforeJobStartXSBO(pinX, pinS, pinB, pinO);

            JobHandle jobFence;

            {
                void *ptrX = pinX.array.RawAddressAt(pinX.offset);
                void *ptrO = pinO.array.RawAddressAt(pinO.offset);
                var   ptrS = pinS.data;
                var   ptrB = pinB.data;
                jobFence = ScheduleXSBOInternal(jobData, fenceBeforeJobStart, ptrX, ptrS, ptrB, ptrO, arrayLength, innerloopBatchCount);
            }

            if (fencingMode == FencingHelperMode.UpdateResourcesFencesOnScheduling)
            {
                jobFence.SetXSBOFences(pinX, pinS, pinB, pinO);
            }

            return(jobFence);
        }