Ejemplo n.º 1
0
 public void TestInitialize()
 {
     for (int i = 0; i < ComputePlatform.Platforms.Count; i++)
     {
         Console.WriteLine("Platform: {0} -> {1}", ComputePlatform.Platforms[i].Vendor, ComputePlatform.Platforms[i].Name);
         for (int j = 0; j < ComputePlatform.Platforms[i].Devices.Count; j++)
         {
             Console.WriteLine("\t{0} Device {1}: {2}", j, ComputePlatform.Platforms[i].Devices[j].Type,
                               ComputePlatform.Platforms[i].Devices[j].Name);
         }
     }
     Device = ComputePlatform.Platforms[0].Devices[0];
     Console.WriteLine("Device: {0}", Device.Name);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets the <see cref="ComputeProgramBuildStatus"/> of the program for a specified device.
 /// </summary>
 /// <param name="device"> The device building the program. Must be one of devices. </param>
 /// <returns> The <see cref="ComputeProgramBuildStatus"/> of the program for device. </returns>
 public ComputeProgramBuildStatus GetBuildStatus(IComputeDevice device)
 {
     return((ComputeProgramBuildStatus)GetInfo <CLProgramHandle, CLDeviceHandle, ComputeProgramBuildInfo, uint>(Handle,
                                                                                                                device.Handle, ComputeProgramBuildInfo.Status, OpenCL100.GetProgramBuildInfo));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Gets the build log of the program for a specified device.
 /// </summary>
 /// <param name="device"> The device building the program. Must be one of devices. </param>
 /// <returns> The build log of the program for device. </returns>
 public string GetBuildLog(IComputeDevice device)
 {
     return(GetStringInfo <CLProgramHandle, CLDeviceHandle, ComputeProgramBuildInfo>(Handle, device.Handle,
                                                                                     ComputeProgramBuildInfo.BuildLog, OpenCL100.GetProgramBuildInfo));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Gets the minimum amount of memory, in bytes, used by each work-item in the kernel.
 /// </summary>
 /// <param name="device"> One of the device. </param>
 /// <returns> The minimum amount of memory, in bytes, used by each work-item in the kernel. </returns>
 /// <remarks> The returned value may include any private memory needed by an implementation to execute the kernel, including that used by the language built-ins and variable declared inside the kernel with the <c>__private</c> or <c>private</c> qualifier. </remarks>
 public long GetPrivateMemorySize(IComputeDevice device)
 {
     return(GetInfo <CLKernelHandle, CLDeviceHandle, ComputeKernelWorkGroupInfo, long>(
                Handle, device.Handle, ComputeKernelWorkGroupInfo.PrivateMemorySize, OpenCL200.GetKernelWorkGroupInfo));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Gets the preferred multiple of workgroup size for launch.
 /// </summary>
 /// <param name="device"> One of the device. </param>
 /// <returns> The preferred multiple of workgroup size for launch. </returns>
 /// <remarks> The returned value is a performance hint. Specifying a workgroup size that is not a multiple of the value returned by this query as the value of the local work size argument to ComputeCommandQueue.Execute will not fail to enqueue the kernel for execution unless the work-group size specified is larger than the device maximum. </remarks>
 /// <remarks> Requires OpenCL 1.1. </remarks>
 public long GetPreferredWorkGroupSizeMultiple(IComputeDevice device)
 {
     return((long)GetInfo <CLKernelHandle, CLDeviceHandle, ComputeKernelWorkGroupInfo, IntPtr>(
                Handle, device.Handle, ComputeKernelWorkGroupInfo.PreferredWorkGroupSizeMultiple, OpenCL200.GetKernelWorkGroupInfo));
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Gets the compile work-group size specified by the <c>__attribute__((reqd_work_group_size(X, Y, Z)))</c> qualifier.
 /// </summary>
 /// <param name="device"> One of the device. </param>
 /// <returns> The compile work-group size specified by the <c>__attribute__((reqd_work_group_size(X, Y, Z)))</c> qualifier. If no such qualifier is specified, (0, 0, 0) is returned. </returns>
 public long[] GetCompileWorkGroupSize(IComputeDevice device)
 {
     return(ComputeTools.ConvertArray(
                GetArrayInfo <CLKernelHandle, CLDeviceHandle, ComputeKernelWorkGroupInfo, IntPtr>(
                    Handle, device.Handle, ComputeKernelWorkGroupInfo.CompileWorkGroupSize, OpenCL200.GetKernelWorkGroupInfo)));
 }
 /// <summary>
 /// Gets the amount of local memory in bytes used by the kernel.
 /// </summary>
 /// <param name="device"> One of the device. </param>
 /// <returns> The amount of local memory in bytes used by the kernel. </returns>
 public long GetLocalMemorySize(IComputeDevice device)
 {
     return(GetInfo <CLKernelHandle, CLDeviceHandle, ComputeKernelWorkGroupInfo, long>(
                Handle, device.Handle, ComputeKernelWorkGroupInfo.LocalMemorySize, OpenCL120.GetKernelWorkGroupInfoWrapper));
 }
 /// <summary>
 /// Gets the maximum work-group size that can be used to execute the kernel on a device.
 /// </summary>
 /// <param name="device"> One of the device. </param>
 /// <returns> The maximum work-group size that can be used to execute the kernel on device. </returns>
 public long GetWorkGroupSize(IComputeDevice device)
 {
     return((long)GetInfo <CLKernelHandle, CLDeviceHandle, ComputeKernelWorkGroupInfo, IntPtr>(
                Handle, device.Handle, ComputeKernelWorkGroupInfo.WorkGroupSize, OpenCL120.GetKernelWorkGroupInfoWrapper));
 }
 /// <summary>
 /// Gets the build log of the program for a specified device.
 /// </summary>
 /// <param name="device"> The device building the program. Must be one of devices. </param>
 /// <returns> The build log of the program for device. </returns>
 public string GetBuildLog(IComputeDevice device)
 {
     return(GetStringInfo(Handle, device.Handle, ComputeProgramBuildInfo.BuildLog, OpenCL200.GetProgramBuildInfoWrapper));
 }