/// <summary> /// OpenCL 1.1 /// </summary> /// <param name="_event"></param> /// <param name="execution_status"></param> public void SetUserEventStatus(ExecutionStatus execution_status) { ErrorCode result; result = OpenCL.SetUserEventStatus(EventID, execution_status); if (result != ErrorCode.SUCCESS) { throw new OpenCLException("SetUserEventStatus failed with error code " + result, result); } }
/// <summary> /// Set argument argIndex to c /// </summary> /// <param name="argIndex"></param> /// <param name="c"></param> public void SetArg(Int32 argIndex, System.UInt16 c) { ErrorCode result; result = OpenCL.SetKernelArg(this.KernelID, (UInt32)argIndex, new IntPtr(sizeof(System.UInt16)), &c); if (result != ErrorCode.SUCCESS) { throw new OpenCLException("SetArg failed with error code " + result, result); } }
public void SetArg(Int32 argIndex, Double2 c) { ErrorCode result; result = OpenCL.SetKernelArg(this.KernelID, (UInt32)argIndex, (IntPtr)sizeof(Double2), &c); if (result != ErrorCode.SUCCESS) { throw new OpenCLException("SetArg failed with error code " + result, result); } }
public void SetByteArg(int argIndex, byte c) { ErrorCode result; result = (ErrorCode)OpenCL.SetKernelArg(KernelID, (uint)argIndex, new IntPtr(sizeof(byte)), &c); if (result != ErrorCode.SUCCESS) { throw new OpenCLException("SetArg failed with error code " + result, result); } }
public void RetainDeviceEXT() { ErrorCode result; result = OpenCL.RetainDeviceEXT(DeviceID); if (result != ErrorCode.SUCCESS) { throw new OpenCLException("RetainDeviceEXT failed with error code: " + result, result); } }
public void SetArg(int argIndex, Double16 c) { ErrorCode result; result = OpenCL.SetKernelArg(KernelID, (uint)argIndex, (IntPtr)sizeof(Double16), &c); if (result != ErrorCode.SUCCESS) { throw new OpenCLException("SetArg failed with error code " + result, result); } }
public void SetArg(int argIndex, IntPtr argSize, IntPtr argValue) { ErrorCode result; result = (ErrorCode)OpenCL.SetKernelArg(KernelID, (uint)argIndex, argSize, argValue.ToPointer()); if (result != ErrorCode.SUCCESS) { throw new OpenCLException("SetArg failed with error code " + result, result); } }
static OpenCL() { try { OpenCL.Initialize(); } catch (Exception) { OpenCL._Platforms.Clear(); OpenCL.PlatformIDs = new IntPtr[0]; OpenCL.Platforms = new Platform[0]; } }
public override unsafe void ReadProperty(uint key, IntPtr keyLength, void *pBuffer) { IntPtr size; ErrorCode result; result = (ErrorCode)OpenCL.GetImageInfo(MemID, key, keyLength, pBuffer, out size); if (result != ErrorCode.SUCCESS) { base.ReadProperty(key, keyLength, pBuffer); } }
public void ReadProperty(UInt32 key, IntPtr keyLength, void *pBuffer) { IntPtr size; ErrorCode result; result = OpenCL.GetContextInfo(this.ContextID, key, keyLength, pBuffer, out size); if (result != ErrorCode.SUCCESS) { throw new OpenCLException("GetContextInfo failed: " + result, result); } }
internal IntPtr ImportFunction(string functionName) { IntPtr entryPoint; entryPoint = OpenCL.GetExtensionFunctionAddressForPlatform(Platform, functionName); if (entryPoint == IntPtr.Zero) { throw new EntryPointNotFoundException("Error when importing function \"" + functionName + "\" from the " + GetName() + " extension"); } return(entryPoint); }
public void ReadProperty(UInt32 key, IntPtr keyLength, void *pBuffer) { IntPtr size; ErrorCode result; result = OpenCL.GetDeviceInfo(this.DeviceID, key, keyLength, pBuffer, out size); if (result != (Int32)ErrorCode.SUCCESS) { throw new OpenCLException("Unable to get device info for device " + this.DeviceID, result); } }
public void ReadProperty(uint key, IntPtr keyLength, void *pBuffer) { IntPtr size; ErrorCode result; result = OpenCL.GetKernelInfo(KernelID, (uint)key, keyLength, pBuffer, out size); if (result != (int)ErrorCode.SUCCESS) { throw new OpenCLException("Unable to get kernel info for kernel " + KernelID, result); } }
public void ReadProperty(UInt32 key, IntPtr keyLength, void *pBuffer) { ErrorCode result; IntPtr size; result = OpenCL.GetProgramInfo(this.ProgramID, key, keyLength, pBuffer, out size); if (result != ErrorCode.SUCCESS) { throw new OpenCLException("clGetProgramInfo failed with error code " + result, result); } }
public void ReadProperty(uint key, IntPtr keyLength, void *pBuffer) { IntPtr size; ErrorCode result; result = (ErrorCode)OpenCL.GetDeviceInfo(DeviceID, (uint)key, keyLength, pBuffer, out size); if (result != (int)ErrorCode.SUCCESS) { throw new OpenCLException("Unable to get device info for device " + DeviceID, result); } }
unsafe public virtual void ReadProperty(uint key, IntPtr keyLength, void *pBuffer) { IntPtr size; ErrorCode result; result = (ErrorCode)OpenCL.GetMemObjectInfo(MemID, key, keyLength, pBuffer, out size); if (result != ErrorCode.SUCCESS) { throw new OpenCLException("GetMemObjectInfo failed: " + result, result); } }
/// <summary> /// OpenCL 1.1 /// </summary> /// <param name="command_exec_callback_type"></param> /// <param name="pfn_notify"></param> /// <param name="user_data"></param> public void SetCallback(ExecutionStatus command_exec_callback_type, EventNotify pfn_notify, object user_data) { ErrorCode result; int callbackId = AddCallback(this, pfn_notify, user_data); result = OpenCL.SetEventCallback(EventID, (int)command_exec_callback_type, CallbackDelegate, (IntPtr)callbackId); if (result != ErrorCode.SUCCESS) { throw new OpenCLException("SetEventCallback failed with error code " + result, result); } }
public void ReadProperty(uint key, IntPtr keyLength, void *pBuffer) { ErrorCode result; IntPtr size; result = (ErrorCode)OpenCL.GetSamplerInfo(SamplerID, key, keyLength, pBuffer, out size); if (result != ErrorCode.SUCCESS) { throw new OpenCLException("clGetSamplerInfo failed with error code " + result, result); } }
public void ReadProperty(uint key, IntPtr keyLength, void *pBuffer) { IntPtr propertySize; ErrorCode result; result = (ErrorCode)OpenCL.GetPlatformInfo(PlatformID, key, keyLength, (void *)pBuffer, out propertySize); if (result != ErrorCode.SUCCESS) { throw new OpenCLException("Unable to get platform info for platform " + PlatformID + ": " + result, result); } }
/// <summary> /// Returns the specified profiling counter /// </summary> /// <param name="paramName"></param> /// <param name="paramValue"></param> public unsafe void GetEventProfilingInfo(ProfilingInfo paramName, out ulong paramValue) { IntPtr paramValueSizeRet; ulong v; ErrorCode errorCode; errorCode = OpenCL.GetEventProfilingInfo(EventID, paramName, (IntPtr)sizeof(ulong), &v, out paramValueSizeRet); if (errorCode != ErrorCode.SUCCESS) throw new OpenCLException("GetEventProfilingInfo failed with error code "+errorCode, errorCode ); paramValue = v; }
public override void ReadProperty(UInt32 key, IntPtr keyLength, void *pBuffer) { IntPtr size; ErrorCode result; result = OpenCL.GetImageInfo(this.MemID, key, keyLength, pBuffer, out size); if (result != ErrorCode.SUCCESS) { base.ReadProperty(key, keyLength, pBuffer); } }
/// <summary> /// Set argument argIndex to c /// </summary> /// <param name="argIndex"></param> /// <param name="c"></param> public void SetArg(int argIndex, IntPtr c) { ErrorCode result; IntPtr lc = c; result = (ErrorCode)OpenCL.SetKernelArg(KernelID, (uint)argIndex, (IntPtr)sizeof(IntPtr), &lc); if (result != ErrorCode.SUCCESS) { throw new OpenCLException("SetArg failed with error code " + result, result); } }
public IntPtr GetPropertySize(uint key) { IntPtr size; ErrorCode result; result = (ErrorCode)OpenCL.GetDeviceInfo(DeviceID, key, IntPtr.Zero, null, out size); if (result != ErrorCode.SUCCESS) { throw new OpenCLException("Unable to get device info for device " + DeviceID, result); } return(size); }
unsafe public virtual IntPtr GetPropertySize(uint key) { IntPtr size; ErrorCode result; result = (ErrorCode)OpenCL.GetMemObjectInfo(MemID, key, IntPtr.Zero, null, out size); if (result != ErrorCode.SUCCESS) { throw new OpenCLException("GetMemObjectInfo failed: " + result, result); } return(size); }
public IntPtr GetPropertySize(uint key) { IntPtr propertySize; ErrorCode result; result = (ErrorCode)OpenCL.GetPlatformInfo(PlatformID, key, IntPtr.Zero, null, out propertySize); if (result != ErrorCode.SUCCESS) { throw new OpenCLException("Unable to get platform info for platform " + PlatformID + ": " + result, result); } return(propertySize); }
public IntPtr GetPropertySize(uint key) { IntPtr size; ErrorCode result; result = (ErrorCode)OpenCL.GetKernelInfo(KernelID, key, IntPtr.Zero, null, out size); if (result != ErrorCode.SUCCESS) { throw new OpenCLException("Unable to get kernel info for kernel " + KernelID, result); } return(size); }
public IntPtr GetPropertySize(uint key) { IntPtr size; ErrorCode result = OpenCL.GetProgramBuildInfo(Program.ProgramID, Device.DeviceID, key, IntPtr.Zero, null, out size);; if (result != ErrorCode.SUCCESS) { throw new OpenCLException("clGetProgramBuildInfo failed with error code " + result, result); } return(size); }
public Kernel CreateKernel(string kernelName) { IntPtr kernelID; ErrorCode result; kernelID = OpenCL.CreateKernel(ProgramID, kernelName, out result); if (result != ErrorCode.SUCCESS) { throw new OpenCLException("CreateKernel failed with error code " + result, result); } return(new Kernel(Context, this, kernelID)); }
// Override the IPropertyContainer interface of the Mem class. #region IPropertyContainer Members public override IntPtr GetPropertySize(UInt32 key) { IntPtr size; ErrorCode result; result = OpenCL.GetImageInfo(this.MemID, key, IntPtr.Zero, null, out size); if (result != ErrorCode.SUCCESS) { size = base.GetPropertySize(key); } return(size); }
/// <summary> /// OpenCL 1.1 /// </summary> /// <returns></returns> public Event CreateUserEvent() { ErrorCode result; IntPtr eventID; eventID = OpenCL.CreateUserEvent(ContextID, out result); if (result != ErrorCode.SUCCESS) { throw new OpenCLException("CreateUserEvent failed with error code " + result, result); } return(new Event(this, null, eventID)); }