Closed
Description
using System;
using System.Reflection;
using System.Numerics;
class X
{
public static int Main()
{
bool hw1 = Vector.IsHardwareAccelerated;
Assembly spc = typeof(object).Assembly;
Type vecType = spc.GetType("System.Numerics.Vector");
MethodInfo method = vecType.GetMethod("get_IsHardwareAccelerated");
bool hw2 = (bool) method.Invoke(null, null);
Console.WriteLine($"Direct call to Vector.IsHardwareAccelerated returns {hw1}");
Console.WriteLine($"Reflection call to Vector.IsHardwareAccelerated returns {hw2}");
return (hw1 == hw2 ? 100 : -1);
}
}
results in
Direct call to Vector.IsHardwareAccelerated returns True
Reflection call to Vector.IsHardwareAccelerated returns False
Seems like we're not recognizing this as an intrinsic when it is jitted on its own.
category:cq
theme:vector-codegen
skill-level:intermediate
cost:medium