How to use polymorphism in CUDA

前端 未结 1 1375
时光说笑
时光说笑 2021-01-18 04:55

I am porting some physics simulation code from C++ to CUDA.

The fundamental algorithm can be understood as: applying an operator to each element of a vector. In pseu

1条回答
  •  清酒与你
    2021-01-18 05:23

    Something like this perhaps...

    template 
    class Composition {...}
    
    template 
    Composition compose(Op1& op1, Op2& op2) {...}
    
    template
    void apply(C& c, VecType& vec){...}
    

    0 讨论(0)
提交回复
热议问题