What steps will reproduce the problem? 1. In file "configure.ocelot" set device to "emulated"
Compile and run the following hello world program
include
include
global
void
helloKernel(){
if(threadIdx.x & 1 > 0){ //odd thread
printf("Hello world, from odd thread %d\n", threadIdx.x);
}else{
printf("Hello world, from even thread %d\n", threadIdx.x);
}
}
int
main(int argc, char* argv[]){
dim3 grid(1,1);
dim3 block(20,1);
helloKernel<<<grid, block>>>();
cudaDeviceReset(); //needed to flush printf cuda buffer
return 0;
}
The printf always prints "0" for every number (I also tried to print constants and literals... same result)
If I remove "emulated" from the device field and leave only "llvm" then the output is as expected What version of the product are you using? On what operating system? gpuocelot 2.1 build 1985
Debian Linux wheezy
From doctorn...@gmail.com on July 23, 2012 17:15:56
What steps will reproduce the problem? 1. In file "configure.ocelot" set device to "emulated"
include
include
global void helloKernel(){ if(threadIdx.x & 1 > 0){ //odd thread printf("Hello world, from odd thread %d\n", threadIdx.x); }else{ printf("Hello world, from even thread %d\n", threadIdx.x); } }
int main(int argc, char* argv[]){ dim3 grid(1,1); dim3 block(20,1); helloKernel<<<grid, block>>>(); cudaDeviceReset(); //needed to flush printf cuda buffer return 0; }
Original issue: http://code.google.com/p/gpuocelot/issues/detail?id=72