Пример #1
0
 /// <summary>
 /// Split the aggregate device into as many smaller aggregate devices as can
 /// be created, each containing <paramref name="partitionSize"/> compute units.
 /// If <paramref name="partitionSize"/> does not divide evenly into
 /// <see cref="MaxComputeUnits"/>, then the remaining compute units are not used.
 /// </summary>
 /// <param name="partitionSize">The size of the partitions to be created.</param>
 /// <returns>A collection of sub-devices representing the created partitions.</returns>
 public DisposableCollection <Device> PartitionEqually(int partitionSize)
 {
     return(UnsafeNativeMethods.PartitionEqually(ID, partitionSize));
 }
Пример #2
0
 /// <summary>
 /// Split the device into smaller aggregate devices containing one or more compute
 /// units that all share part of a cache hierarchy. The value accompanying this
 /// property may be drawn from the following list:
 ///
 /// <list type="bullet">
 /// <item><see cref="AffinityDomain.Numa"/> - Split the device into sub-devices comprised of compute units that share a NUMA node.</item>
 /// <item><see cref="AffinityDomain.L4Cache"/> - Split the device into sub-devices comprised of compute units that share a level 4 data cache.</item>
 /// <item><see cref="AffinityDomain.L3Cache"/> - Split the device into sub-devices comprised of compute units that share a level 3 data cache.</item>
 /// <item><see cref="AffinityDomain.L2Cache"/> - Split the device into sub-devices comprised of compute units that share a level 2 data cache.</item>
 /// <item><see cref="AffinityDomain.L1Cache"/> - Split the device into sub-devices comprised of compute units that share a level 1 data cache.</item>
 /// <item><see cref="AffinityDomain.NextPartitionable"/> - Split the device along the next partitionable affinity domain. The implementation shall find the first level along which the device or sub-device may be further subdivided in the order NUMA, L4, L3, L2, L1, and partition the device into sub-devices comprised of compute units that share memory subsystems at this level.</item>
 /// </list>
 ///
 /// The user may determine what happened by checking <see cref="PartitionType"/> on the sub-devices.
 /// </summary>
 /// <param name="affinityDomain">Specifies the cache hierarchy shared by the partitioned compute units.</param>
 /// <returns>A collection of sub-devices representing the created partitions.</returns>
 public DisposableCollection <Device> PartitionByAffinityDomain(AffinityDomain affinityDomain)
 {
     return(UnsafeNativeMethods.PartitionByAffinityDomain(ID, affinityDomain));
 }
Пример #3
0
 public Device[] GetDevices(DeviceType deviceType)
 {
     UnsafeNativeMethods.ClDeviceID[] devices = UnsafeNativeMethods.GetDeviceIDs(ID, deviceType);
     return(Array.ConvertAll(devices, device => new Device(device)));
 }
Пример #4
0
#pragma warning disable CS1574 // XML comment has cref attribute that could not be resolved
        /// <summary>
        /// Allows the implementation to release the resources allocated by the OpenCL compiler for this platform.
        /// </summary>
        /// <remarks>
        /// This is a hint from the application and does not guarantee that the compiler will not be used
        /// in the future or that the compiler will actually be unloaded by the implementation. Calls to
        /// <see cref="Program.Build()" autoUpgrade="true"/>, <see cref="Program.Compile"/>, or
        /// <see cref="Context.LinkProgram"/> after <see cref="UnloadCompiler"/> will reload the compiler, if necessary,
        /// to build the appropriate program executable.
        /// </remarks>
        public void UnloadCompiler()
#pragma warning restore CS1574 // XML comment has cref attribute that could not be resolved
        {
            UnsafeNativeMethods.UnloadPlatformCompiler(ID);
        }
Пример #5
0
 public static Platform[] GetPlatforms()
 {
     UnsafeNativeMethods.ClPlatformID[] platforms = UnsafeNativeMethods.GetPlatformIDs();
     return(Array.ConvertAll(platforms, platform => new Platform(platform)));
 }
Пример #6
0
 public ulong GetPrivateMemorySize(Device device)
 {
     return(UnsafeNativeMethods.GetKernelWorkGroupInfo(Handle, device.ID, UnsafeNativeMethods.KernelWorkGroupInfo.PrivateMemorySize));
 }
Пример #7
0
 public IntPtr GetPreferredWorkGroupSizeMultiple(Device device)
 {
     return(UnsafeNativeMethods.GetKernelWorkGroupInfo(Handle, device.ID, UnsafeNativeMethods.KernelWorkGroupInfo.PreferredWorkGroupSizeMultiple));
 }
Пример #8
0
 public IReadOnlyList <IntPtr> GetCompileWorkGroupSize(Device device)
 {
     return(UnsafeNativeMethods.GetKernelWorkGroupInfo(Handle, device.ID, UnsafeNativeMethods.KernelWorkGroupInfo.CompileWorkGroupSize));
 }
Пример #9
0
 public IntPtr GetWorkGroupSize(Device device)
 {
     return(UnsafeNativeMethods.GetKernelWorkGroupInfo(Handle, device.ID, UnsafeNativeMethods.KernelWorkGroupInfo.WorkGroupSize));
 }