gpt4 book ai didi

c# - Visual Studio 的 'watch' 错误地将 Vector 中的一半数字显示为零

转载 作者:行者123 更新时间:2023-12-02 05:16:19 26 4
gpt4 key购买 nike

这是 VS 2017 watch 中的错误,还是我做了一些愚蠢的事情?它不显示 Vector 的一半内容。 (在我的系统上,Vector.Count 是 8)。

enter image description here

    [Test]
public void inspectVector()
{
var numbers = new float[] { 1, 2, 3, 4, 5, 6, 7, 8 };

var inputVector = new Vector<float>(numbers);


var five = inputVector[4]; //this is fine - 5

float[] numbersCopiedBack = new float[8];
inputVector.CopyTo(numbersCopiedBack); //this is fine - 1, 2, 3, 4, 5, 6, 7, 8
}

这看起来很奇怪。为什么 inputVector 的监视不显示一半的数字,即使它看起来表现正常?问题也存在于“监视”窗口中 - 但是,ToString() 正确显示 <1, 2, 3, 4, 5, 6, 7, 8>

我正在运行 Microsoft Visual Studio Professional 2017,版本 15.4.2 15.7.5,并使用 System.Numerics.Vectors v 4.5.0。我尝试过调试和发布;我在关闭优化的情况下运行(据我所知,在这种情况下您实际上并没有获得 SIMD 优化;但在这里,我只想调试一个算法)。

最佳答案

显然,这实际上是一个已知问题 - “调试器无法正确处理没有支持字段的字节。” -https://github.com/dotnet/coreclr/issues/16280 .

关于c# - Visual Studio 的 'watch' 错误地将 Vector<float> 中的一半数字显示为零,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51570775/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com