コード例 #1
0
 public VulkanComputeProvider(VulkanDevice device, ComputeProfiler profiler)
 {
     _device   = device;
     _profiler = profiler;
 }
コード例 #2
0
 /// <summary>
 /// Converts an <see cref="IEnumerable{T}"/> to an <see cref="IQueryable{T}"/> that is
 /// capable of executing the query on GPU.
 /// </summary>
 /// <typeparam name="T">The type of the elements of <paramref name="source"/></typeparam>
 /// <param name="source">A sequence to convert.</param>
 /// <param name="profiler">
 /// An optional profiler that will measure the timings of operating with GPU.
 /// </param>
 /// <returns>
 /// An <see cref="IQueryable{T}"/> that represents the input sequence as a GPU compute query.
 /// </returns>
 public static VulkanComputeQuery <T> AsCompute <T>(this IEnumerable <T> source, ComputeProfiler profiler = null)
 {
     return(new VulkanComputeProvider(VulkanDevice.Default, profiler)
            .CreateQuery <T>(source.AsQueryable().Expression));
 }