Forum Discussion
RJin1
New Contributor
7 years agoKernel Vectorization: branching is thread ID dependent ... cannot vectorize
I have the following code, and in the kernel the norm is get from the rowdata and row data is dependent on the thread ID. In the myfastsquaredDistance function, the if else statement is dependent on...
HRZ
Frequent Contributor
7 years agoYour code does not compile as it is due to missing definition for many of the functions. I believe it requires an external header. Please provide a code snippet that can be compiled (preferably using the code insertion mechanism provided in the forum so that indentation is preserved) so that we can take a look at the report and compiler messages. I fail to see why this cannot be vectorized, though; the statement in the condition does not depend on thread-ID, only its value does. You might be able to get around it using the (condition) ? (value1) : (value2) notation instead of if/else.