Esempio n. 1
0
        /// <summary>
        /// Constructs a new CPU-based runtime context for parallel processing.
        /// </summary>
        /// <param name="multiprocessor">The target CPU multiprocessor.</param>
        protected CPURuntimeContext(CPUMultiprocessor multiprocessor)
        {
            Multiprocessor = multiprocessor
                             ?? throw new ArgumentNullException(nameof(multiprocessor));

            broadcastBuffer = new CPUMemoryBufferCache(multiprocessor.Accelerator);
            broadcastBuffer.Allocate <int>(16);
        }
Esempio n. 2
0
        /// <summary>
        /// Constructs a new CPU-based runtime context for parallel processing.
        /// </summary>
        /// <param name="multiprocessor">The target CPU multiprocessor.</param>
        /// <param name="numThreadsPerWarp">The number of threads per warp.</param>
        public CPURuntimeWarpContext(
            CPUMultiprocessor multiprocessor,
            int numThreadsPerWarp)
            : base(multiprocessor)
        {
            WarpSize = numThreadsPerWarp;

            shuffleBuffer = new CPUMemoryBufferCache(Multiprocessor.Accelerator);
            shuffleBuffer.Allocate <int>(2 * sizeof(int) * numThreadsPerWarp);
        }