Reputation: 2148
If I use preprocessor directives like #if
, #elif
, etc., in my kernel , will it affect the performance in any way? I'm assuming that these conditions are resolved at the compile time itself.
Upvotes: 1
Views: 124
Reputation: 445
If you do live compilation then it will probably have some effect on the compiletime but the on the actual execution of the kernel it won't have any affect since they are resolved at the compile time just as you said. The potential slowdown on compiletime should be way less than doing all those checks at run time.
Upvotes: 2