예제 #1
0
        public FourierTask(WaveSpectrumBufferCPU buffer, FourierCPU fourier, int index, int numGrids)
            : base(true)
        {
            if (m_index == -1)
            {
                throw new InvalidOperationException("Index can be -1. Fourier for multiple buffers is not being used");
            }

            if (!(buffer is DisplacementBufferCPU)) //TODO - fix me
            {
                throw new InvalidOperationException("Fourier task currently only designed for displacement buffers");
            }

            m_buffer = buffer as DisplacementBufferCPU;

            m_fourier = fourier;

            m_index = index;

            m_numGrids = numGrids;

            WaveSpectrumBufferCPU.Buffer b = m_buffer.GetBuffer(m_index);

            m_data         = b.data;
            m_results      = b.results;
            m_map          = b.map;
            m_doublePacked = b.doublePacked;
        }
예제 #2
0
 public WaveSpectrumBufferCPU(int size, int numBuffers, Scheduler scheduler)
 {
     this.m_buffers      = new WaveSpectrumBufferCPU.Buffer[numBuffers];
     this.m_fourier      = new FourierCPU(size);
     this.m_fourierTasks = new List <FourierTask>(3);
     this.m_fourierTasks.Add(null);
     this.m_fourierTasks.Add(null);
     this.m_fourierTasks.Add(null);
     this.m_scheduler = scheduler;
     for (int i = 0; i < numBuffers; i++)
     {
         this.m_buffers[i] = this.CreateBuffer(size);
     }
 }
예제 #3
0
 public WaveSpectrumBufferCPU(int size, int numBuffers, Scheduler scheduler)
 {
     this.m_buffers = new WaveSpectrumBufferCPU.Buffer[numBuffers];
     this.m_fourier = new FourierCPU(size);
     this.m_fourierTasks = new List<FourierTask>(3);
     this.m_fourierTasks.Add(null);
     this.m_fourierTasks.Add(null);
     this.m_fourierTasks.Add(null);
     this.m_scheduler = scheduler;
     for (int i = 0; i < numBuffers; i++)
     {
         this.m_buffers[i] = this.CreateBuffer(size);
     }
 }
예제 #4
0
        public WaveSpectrumBufferCPU(int size, int numBuffers, Scheduler scheduler)
        {
            m_buffers = new Buffer[numBuffers];

            m_fourier = new FourierCPU(size);

            m_fourierTasks = new List <ThreadedTask>();

            m_scheduler = scheduler;

            for (int i = 0; i < numBuffers; i++)
            {
                m_buffers[i] = CreateBuffer(size);
            }
        }
예제 #5
0
        public WaveSpectrumBufferCPU(int size, int numBuffers, Scheduler scheduler)
        {
            m_buffers = new Buffer[numBuffers];

            m_fourier = new FourierCPU(size);           //OYM:  创建傅里叶CPU算法的基础

            m_fourierTasks = new List <FourierTask>(3); //OYM:  一脸懵逼
            m_fourierTasks.Add(null);
            m_fourierTasks.Add(null);
            m_fourierTasks.Add(null);

            m_scheduler = scheduler;             //OYM:  多线程任务处理

            for (int i = 0; i < numBuffers; i++) //OYM:  这个好像是个常数,总之就是给你三块缓存空间
            {
                m_buffers[i] = CreateBuffer(size);
            }
        }
예제 #6
0
        public FourierTask(WaveSpectrumBufferCPU buffer, FourierCPU fourier, int index, int numGrids)
            : base(true)
        {
            if(m_index == -1)
                throw new InvalidOperationException("Index can be -1. Fourier for multiple buffers is not being used");

            m_buffer = buffer;

            m_fourier = fourier;

            m_index = index;

            m_numGrids = numGrids;

            var b = m_buffer.GetBuffer(m_index);

            m_data = b.data;
            m_results = b.results;
            m_doublePacked = b.doublePacked;
        }
예제 #7
0
 public FourierTask(WaveSpectrumBufferCPU buffer, FourierCPU fourier, int index, int numGrids)
     : base(true)
 {
     if (this.m_index == -1)
     {
         throw new InvalidOperationException("Index can be -1. Fourier for multiple buffers is not being used");
     }
     if (!(buffer is DisplacementBufferCPU))
     {
         throw new InvalidOperationException("Fourier task currently only designed for displacement buffers");
     }
     this.m_buffer = (buffer as DisplacementBufferCPU);
     this.m_fourier = fourier;
     this.m_index = index;
     this.m_numGrids = numGrids;
     WaveSpectrumBufferCPU.Buffer buffer2 = this.m_buffer.GetBuffer(this.m_index);
     this.m_data = buffer2.data;
     this.m_results = buffer2.results;
     this.m_map = buffer2.map;
     this.m_doublePacked = buffer2.doublePacked;
 }
        public FourierTask(WaveSpectrumBufferCPU buffer, FourierCPU fourier, int index, int numGrids)
            : base(true)
        {
            if (m_index == -1)
            {
                throw new InvalidOperationException("Index can be -1. Fourier for multiple buffers is not being used");
            }

            m_buffer = buffer;

            m_fourier = fourier;

            m_index = index;

            m_numGrids = numGrids;

            var b = m_buffer.GetBuffer(m_index);

            m_data         = b.data;
            m_results      = b.results;
            m_doublePacked = b.doublePacked;
        }