Hybridizer HOWTO — Virtual Functions

Hybridizer supports virtual functions. If an implementation/override of a virtual needs to be available on the GPU, it has to be flagged with a Kernel attribute.


public interface ISimple
{
    int f();
}

public class Answer : ISimple
{
    [Kernel]
    public int f()
    {
        return 42 ;
    }
}

public class Other : ISimple
{
    [Kernel]
    public int f()
    {
        return 12;
    }
}


Tags: ,