How to implement device side CUDA virtual functions?
问题 I see that CUDA doesn't allow for classes with virtual functions to be passed into kernel functions. Are there any work-arounds to this limitation? I would really like to be able to use polymorphism within a kernel function. Thanks! 回答1: The most important part of Robert Crovella's comment is: The objects simply need to be created on the device. So keeping that in mind, I was dealing with situation where I had an abstract class Function and then some implementations of it encapsulating