private void UpdateBuffer(EvaluationContext context) { int stride = Stride.GetValue(context); int sizeInBytes = stride * Count.GetValue(context); bool createSrv = CreateSrv.GetValue(context); bool createUav = CreateUav.GetValue(context); var bufferFlags = BufferFlags.GetValue(context); if (sizeInBytes <= 0) { return; } if (BufferWithViews.Value == null) { BufferWithViews.Value = new BufferWithViews(); } ResourceManager.Instance().SetupStructuredBuffer(sizeInBytes, stride, ref BufferWithViews.Value.Buffer); if (createSrv) { ResourceManager.Instance().CreateStructuredBufferSrv(BufferWithViews.Value.Buffer, ref BufferWithViews.Value.Srv); } if (createUav) { ResourceManager.Instance().CreateStructuredBufferUav(BufferWithViews.Value.Buffer, bufferFlags, ref BufferWithViews.Value.Uav); } }
public override void Save(XmlElement layer) { layer.SetAttribute("size", Size.ToString()); layer.SetAttribute("filter", Filter.Serialize()); layer.SetAttribute("stride", Stride.Serialize()); layer.SetAttribute("padding", Padding.Serialize()); layer.SetAttribute("activation", Activation.ToString()); }
/// <summary> /// Write instruction operands into bytecode stream. /// </summary> /// <param name="writer">Bytecode writer.</param> public override void WriteOperands(WordWriter writer) { Execution.Write(writer); Destination.Write(writer); Source.Write(writer); NumElements.Write(writer); Stride.Write(writer); Event.Write(writer); }
public override int GetHashCode() { unchecked { var hashCode = 397 ^ Shape.GetHashCode(); hashCode = (hashCode * 397) ^ Stride.GetHashCode(); hashCode = (hashCode * 397) ^ Offset.GetHashCode(); return(hashCode); } }
/// <summary> /// Write instruction operands into bytecode stream. /// </summary> /// <param name="writer">Bytecode writer.</param> public override void WriteOperands(WordWriter writer) { Pointer.Write(writer); Stride.Write(writer); ColumnMajor.Write(writer); if (MemoryAccess != null) { MemoryAccess.Write(writer); } }
/// <summary> /// Calculate number of words to fit complete instruction bytecode. /// </summary> /// <returns>Number of words in instruction bytecode.</returns> public override uint GetWordCount() { uint wordCount = 0; wordCount += Pointer.GetWordCount(); wordCount += Object.GetWordCount(); wordCount += Stride.GetWordCount(); wordCount += ColumnMajor.GetWordCount(); wordCount += MemoryAccess?.GetWordCount() ?? 0u; return(wordCount); }
private void UpdateBuffer(EvaluationContext context) { int stride = Stride.GetValue(context); int sizeInBytes = stride * Count.GetValue(context); if (sizeInBytes <= 0) { return; } ResourceManager.Instance().SetupStructuredBuffer(sizeInBytes, stride, ref Buffer.Value); }
/// <summary> /// Calculate number of words to fit complete instruction bytecode. /// </summary> /// <returns>Number of words in instruction bytecode.</returns> public override uint GetWordCount() { uint wordCount = 0; wordCount += IdResultType.GetWordCount(); wordCount += IdResult.GetWordCount(); wordCount += Execution.GetWordCount(); wordCount += Destination.GetWordCount(); wordCount += Source.GetWordCount(); wordCount += NumElements.GetWordCount(); wordCount += Stride.GetWordCount(); wordCount += Event.GetWordCount(); return(wordCount); }
/// <summary> /// Writes the layer as XML /// </summary> /// <param name="writer">The XML writer</param> public void WriteTo(XmlWriter writer) { writer.WriteStartElement("convolutional-layer"); writer.WriteAttributeString("type", Type.ToString()); writer.WriteAttributeString("filter-width", FilterWidth.ToString()); writer.WriteAttributeString("filter-height", FilterHeight.ToString()); writer.WriteAttributeString("stride", Stride.ToString()); if (Padding > 0) { writer.WriteAttributeString("pading", Padding.ToString()); } if (Data != null) { Data.WriteTo(writer); } writer.WriteEndElement(); }
private void UpdateBuffer(EvaluationContext context) { int stride = Stride.GetValue(context); int sizeInBytes = stride * Count.GetValue(context); if (sizeInBytes <= 0) { return; } var bufferDesc = new BufferDescription { Usage = ResourceUsage.Default, BindFlags = BindFlags.UnorderedAccess | BindFlags.ShaderResource, SizeInBytes = sizeInBytes, OptionFlags = ResourceOptionFlags.DrawIndirectArguments, StructureByteStride = stride }; ResourceManager.Instance().SetupBuffer(bufferDesc, ref Buffer.Value); }
/// <summary> /// Element-wise equality. /// </summary> /// <param name="other">The instance to compare to.</param> /// <returns>True if all elements and all array elements are equal; false otherswise.</returns> public bool Equals(VertexLayoutDescription other) { return(Stride.Equals(other.Stride) && Util.ArrayEqualsEquatable(Elements, other.Elements) && InstanceStepRate.Equals(other.InstanceStepRate)); }
/// <summary> /// Returns the hash code for this instance. /// </summary> /// <returns>A 32-bit signed integer that is the hash code for this instance.</returns> public override int GetHashCode() { return(HashHelper.Combine(Stride.GetHashCode(), HashHelper.Array(Elements), InstanceStepRate.GetHashCode())); }
public LongIteratorAnonymousInnerClass(SynchronizedArrayIdOrderingQueueStressTest outerInstance) { this.outerInstance = outerInstance; stride = new Stride(); }
public override string ToString() { return(Stride.ToString() + ": " + Count.ToString() + ": " + Flags.ToString() + ": " + Types.ToString()); }
public override void Save(XmlElement layer) { layer.SetAttribute("filter", Filter.Serialize()); layer.SetAttribute("stride", Stride.Serialize()); layer.SetAttribute("pooling-type", Type.ToString()); }
//ncrunch: no coverage start public override int GetHashCode() { return(Elements.GetHashCode() ^ Stride.GetHashCode()); } //ncrunch: no coverage end