Ejemplo n.º 1
0
 public void Dispose()
 {
     if (this.buffer != null)
     {
         this.buffer.UnmapBufferToPointer();
         this.buffer = null;
     }
 }
Ejemplo n.º 2
0
        /// <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);
            }
        }
Ejemplo n.º 3
0
 public BufferWriteAccessToken(OpenCLBuffer buffer)
 {
     this.buffer = buffer;
     this.buffer.MapBufferToPointerWritable();
 }