Exemplo n.º 1
0
 /// <summary cref="CudaAPI.GetDeviceAttribute(out int, DeviceAttribute, int)"/>
 internal override CudaError GetDeviceAttribute(
     out int value,
     DeviceAttribute attribute,
     int device) =>
 cuDeviceGetAttribute(out value, attribute, device);
Exemplo n.º 2
0
 internal DeviceTemplate(Plugin plugin, [NotNull] Type clz, [NotNull] DeviceAttribute attr, [NotNull] IDeviceFactory factory) : base(plugin)
 {
     Clz       = clz ?? throw new ArgumentNullException(nameof(clz));
     Attribute = attr ?? throw new ArgumentNullException(nameof(attr));
     Factory   = factory ?? throw new ArgumentNullException(nameof(factory));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Resolves the value of the given device attribute.
 /// </summary>
 /// <param name="attribute">The device attribute.</param>
 /// <param name="device">The device.</param>
 /// <returns>The resolved value.</returns>
 internal int GetDeviceAttribute(DeviceAttribute attribute, int device)
 {
     CudaException.ThrowIfFailed(
         GetDeviceAttribute(out int value, attribute, device));
     return(value);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Resolves the value of the given device attribute.
 /// </summary>
 /// <param name="value">The resolved value.</param>
 /// <param name="attribute">The device attribute.</param>
 /// <param name="device">The device.</param>
 /// <returns>The error status.</returns>
 internal abstract CudaError GetDeviceAttribute(
     out int value,
     DeviceAttribute attribute,
     int device);
Exemplo n.º 5
0
 private static extern CudaError cuDeviceGetAttribute(
     [Out] out int value,
     [In] DeviceAttribute attribute,
     [In] int device);
Exemplo n.º 6
0
 /// <summary>
 /// Implements basic functionality for getting function definitions by ID for devices
 /// </summary>
 /// <param name="attr">DeviceAttribute class containing Node name, attribute name, attribute value defining device, Define node name, and Define attribute</param>
 /// <param name="id">Function id</param>
 /// <returns>comma separated string</returns>
 private static string GetDefinitionBase(DeviceAttribute attr, string id)
 {
     return((new YQuery(Atomics.UnitDescription)).GetNode(attr.TagName, attr.Name, attr.Value).GetNode(attr.DefineTag, attr.DefineAttribute, id).Value);
 }