Пример #1
0
 /// <inheritdoc/>
 protected override void DisposeAcceleratorObject(bool disposing)
 {
     CLException.VerifyDisposed(
         disposing,
         CurrentAPI.clReleaseEvent(EventPtr));
     EventPtr = IntPtr.Zero;
 }
Пример #2
0
 /// <summary>
 /// Disposes this OpenCL buffer.
 /// </summary>
 protected override void DisposeAcceleratorObject(bool disposing)
 {
     CLException.VerifyDisposed(
         disposing,
         CurrentAPI.ReleaseBuffer(NativePtr));
     NativePtr = IntPtr.Zero;
 }
Пример #3
0
        /// <summary>
        /// Disposes this OpenCL stream.
        /// </summary>
        protected override void DisposeAcceleratorObject(bool disposing)
        {
            if (!responsibleForHandle || queuePtr == IntPtr.Zero)
            {
                return;
            }

            CLException.VerifyDisposed(
                disposing,
                CurrentAPI.ReleaseCommandQueue(queuePtr));
            queuePtr = IntPtr.Zero;
        }
Пример #4
0
        /// <summary>
        /// Disposes this OpenCL kernel.
        /// </summary>
        protected override void DisposeAcceleratorObject(bool disposing)
        {
            // Free the kernel
            if (kernelPtr != IntPtr.Zero)
            {
                CLException.VerifyDisposed(
                    disposing,
                    CurrentAPI.ReleaseKernel(kernelPtr));
                kernelPtr = IntPtr.Zero;
            }

            // Free the surrounding program
            if (programPtr != IntPtr.Zero)
            {
                CLException.VerifyDisposed(
                    disposing,
                    CurrentAPI.ReleaseProgram(programPtr));
                programPtr = IntPtr.Zero;
            }
        }
Пример #5
0
 /// <summary>
 /// Disposes the current OpenCL context.
 /// </summary>
 protected override void DisposeAccelerator_SyncRoot(bool disposing) =>
 // Dispose the current context
 CLException.VerifyDisposed(
     disposing,
     CurrentAPI.ReleaseContext(NativePtr));