I 'm kind of new to llvm/clang/llc and when I tried to compile a simple
opencl code... well it kind of failed...
Now it might be just me not doing what is required for the cross-compilation
to succeed, but my opencl code is not tricky though llvm fails giving me a
"Cannot select: 0x1c8a340: i32 = ExternalSymbol'log2f'" error.
I do have a log function called in my code which basically does the
*key = *ctr-1;
float b = *ctr;
float c = *key;
__kernel void kernel
__global float *tab
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) *
float configThr = (float)idx;
float etatThr = (float)idx;
tab[idx] = tab[idx] * log(1.f-random(&etatThr, &configThr));
As you'll notice this code makes no sense at all but that is not the point
as I tried to highlight how simple it is.
I'm using the following lines to build a .ptx file :
-target nvptx \
test.cl -o test.ll \
-include clc/clc.h \
llc -march nvptx test.ll -mcpu=sm_20 -mattr=ptx30 -o test.ptx
I have llvm/clang 3.4 from january 2014.
Is this something I'm doing wrong ?
Can you guys think of workaround I could try ?
Anyway thank you for reading that, any hint will be greatly appreciated...