我找到了一种方法来检测,但它不能在我的电脑上使用最新的chrome启用simd标志:
var simd = async () => WebAssembly.validate(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 10, 9, 1, 7, 0, 65, 0, 253, 4, 26, 11]));
await simd();
有没有其他方法来检测?
发布于 2020-05-12 18:11:03
这里有一个用于wasm功能检测的开源库:
https://github.com/GoogleChromeLabs/wasm-feature-detect
它的工作方式是尝试使用给定的功能实例化一个wasm模块,在出现错误时捕获错误(这表明该功能不受支持)。
下面是它试图创建的SIMD模块:
https://github.com/GoogleChromeLabs/wasm-feature-detect/blob/master/src/detectors/simd/module.wat
https://stackoverflow.com/questions/61745021
复制相似问题