[LLVMdev] Error at backend compilation when created a .ptx file for opencl use

L Dumas loic.dumas at c-s.fr
Mon Mar 17 08:56:02 PDT 2014


So I gave it a little more work...

Those lines are sufficient for the problem to appear :
__kernel void lancementKernel 
(
    __global    float           *tabPhotons
) 
{ 
    // idx est l'indice du thread considéré
    unsigned int idx = get_local_id(1) + get_local_size(1) *
(get_local_id(0) + get_local_size(0) * ( get_group_id(1) + get_group_id(0) *
get_num_groups(1)));
    tabPhotons[idx] = tabPhotons[idx] * log(1.f-(float)idx);
};


I have used -fmacro-backtrace-limit=0 on clang and the .i file generated
actually shows that my log call has been replaced by _clc_log2 which leads
me to llvm.log2 for float type.

It looks like there could be no implementation of log2 for float type. Does
that ring a bell to someone ? I have no clue about where the _clc_functions
are supposed to be defined. I feel like this should not be a hard issue but
I'm still trying to understand how clang/llvm works since I'm not familiar
with the whole cross-compilation process.


I hope I am not wasting your time with some misunderstanding of my own....
Thank you for taking the time to read this post, hopefully you will know how
to help me get through that situation.



--
View this message in context: http://llvm.1065342.n5.nabble.com/Error-at-backend-compilation-when-created-a-ptx-file-for-opencl-use-tp66872p66877.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.




More information about the llvm-dev mailing list