예제 #1
0
 public void Dispose()
 {
     if (this.buffer != null)
     {
         this.buffer.UnmapBufferToPointer();
         this.buffer = null;
     }
 }
        /// <summary>
        /// Binds buffer to this kernel before execution
        /// </summary>
        /// <param name="buffer">Buffer</param>
        /// <returns>Current instance of kernel</returns>
        public unsafe OpenCLKernel BindBuffer(OpenCLBuffer buffer)
        {
            try {
                kernel.Arguments[currentArg].SetValue(buffer.Buffer);
                currentArg++;

                return(this);
            } catch (Exception ex) {
                throw new OpenCLException("Cannot create buffer. Buffer size is probably too high.", ex);
            }
        }
예제 #3
0
 public BufferWriteAccessToken(OpenCLBuffer buffer)
 {
     this.buffer = buffer;
     this.buffer.MapBufferToPointerWritable();
 }