static ComputePlatform() { lock (typeof(ComputePlatform)) { try { if (platforms != null) return; CLPlatformHandle[] handles; int handlesLength; ComputeErrorCode error = CL12.GetPlatformIDs(0, null, out handlesLength); ComputeException.ThrowOnError(error); handles = new CLPlatformHandle[handlesLength]; error = CL12.GetPlatformIDs(handlesLength, handles, out handlesLength); ComputeException.ThrowOnError(error); List<ComputePlatform> platformList = new List<ComputePlatform>(handlesLength); foreach (CLPlatformHandle handle in handles) platformList.Add(new ComputePlatform(handle)); platforms = platformList.AsReadOnly(); } catch (DllNotFoundException) { platforms = new List<ComputePlatform>().AsReadOnly(); } } }
public static extern ComputeErrorCode GetPlatformInfo( CLPlatformHandle platform, ComputePlatformInfo param_name, IntPtr param_value_size, IntPtr param_value, out IntPtr param_value_size_ret);
public static extern ComputeErrorCode GetDeviceIDs( CLPlatformHandle platform, ComputeDeviceTypes device_type, Int32 num_entries, [Out, MarshalAs(UnmanagedType.LPArray)] CLDeviceHandle[] devices, out Int32 num_devices);
public ComputeErrorCode GetPlatformInfo(CLPlatformHandle platform, ComputePlatformInfo param_name, IntPtr param_value_size, IntPtr param_value, out IntPtr param_value_size_ret) { return StaticGetPlatformInfo(platform, param_name, param_value_size, param_value, out param_value_size_ret); }
public IntPtr GetExtensionFunctionAddressForPlatform(CLPlatformHandle platform, string func_name) { throw new NotImplementedException(); }
public new IntPtr GetExtensionFunctionAddressForPlatform(CLPlatformHandle platform, String func_name) { return StaticGetExtensionFunctionAddressForPlatform(platform, func_name); }
public static extern IntPtr StaticGetExtensionFunctionAddressForPlatform(CLPlatformHandle platform, String func_name);
public static void GetDeviceIDsWrapper(CLPlatformHandle platform, ComputeDeviceTypes device_type, Int32 num_entries, CLDeviceHandle[] devices, out Int32 num_devices) { ComputeException.ThrowOnError(GetDeviceIDs(platform, device_type, num_entries, devices, out num_devices)); }
ComputeErrorCode ICL10.GetPlatformInfo(CLPlatformHandle platform, ComputePlatformInfo param_name, IntPtr param_value_size, IntPtr param_value, out IntPtr param_value_size_ret) { return GetPlatformInfo(platform, param_name, param_value_size, param_value, out param_value_size_ret); }
ComputeErrorCode ICL10.GetDeviceIDs(CLPlatformHandle platform, ComputeDeviceTypes device_type, int num_entries, CLDeviceHandle[] devices, out int num_devices) { return GetDeviceIDs(platform, device_type, num_entries, devices, out num_devices); }
ComputeErrorCode ICL10.GetPlatformIDs(int num_entries, CLPlatformHandle[] platforms, out int num_platforms) { return GetPlatformIDs(num_entries, platforms, out num_platforms); }
ComputeErrorCode ICL10.GetDeviceIDs(CLPlatformHandle platform, ComputeDeviceTypes device_type, int num_entries, CLDeviceHandle[] devices, out int num_devices) { return(GetDeviceIDs(platform, device_type, num_entries, devices, out num_devices)); }
ComputeErrorCode ICL10.GetPlatformInfo(CLPlatformHandle platform, ComputePlatformInfo param_name, IntPtr param_value_size, IntPtr param_value, out IntPtr param_value_size_ret) { return(GetPlatformInfo(platform, param_name, param_value_size, param_value, out param_value_size_ret)); }
public static extern IntPtr GetExtensionFunctionAddressForPlatform( CLPlatformHandle platform, String func_name);
public extern static ComputeErrorCode GetPlatformInfo( CLPlatformHandle platform, ComputePlatformInfo param_name, IntPtr param_value_size, IntPtr param_value, out IntPtr param_value_size_ret);
private ComputePlatform(CLPlatformHandle handle) { Handle = handle; SetID(Handle.Value); string extensionString = GetStringInfo<CLPlatformHandle, ComputePlatformInfo>(Handle, ComputePlatformInfo.Extensions, CLInterface.CL12.GetPlatformInfo); extensions = new ReadOnlyCollection<string>(extensionString.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)); name = GetStringInfo<CLPlatformHandle, ComputePlatformInfo>(Handle, ComputePlatformInfo.Name, CLInterface.CL12.GetPlatformInfo); profile = GetStringInfo<CLPlatformHandle, ComputePlatformInfo>(Handle, ComputePlatformInfo.Profile, CLInterface.CL12.GetPlatformInfo); vendor = GetStringInfo<CLPlatformHandle, ComputePlatformInfo>(Handle, ComputePlatformInfo.Vendor, CLInterface.CL12.GetPlatformInfo); version = GetStringInfo<CLPlatformHandle, ComputePlatformInfo>(Handle, ComputePlatformInfo.Version, CLInterface.CL12.GetPlatformInfo); QueryDevices(); }
public extern static ComputeErrorCode GetDeviceIDs( CLPlatformHandle platform, ComputeDeviceTypes device_type, Int32 num_entries, [Out, MarshalAs(UnmanagedType.LPArray)] CLDeviceHandle[] devices, out Int32 num_devices);
public static void GetPlatformInfoWrapper(CLPlatformHandle platform, ComputePlatformInfo param_name, IntPtr param_value_size, IntPtr param_value, out IntPtr param_value_size_ret) { ComputeException.ThrowOnError(GetPlatformInfo(platform, param_name, param_value_size, param_value, out param_value_size_ret)); }