Closed GoogleCodeExporter closed 8 years ago
This is an example program that causes nvcc to generate function calls:
#define SIZE 100
__noinline__ __device__ float value( ) {
return 0.0f;
}
__global__ void kernel(float* x) {
const unsigned p = blockIdx.x*blockDim.x + threadIdx.x;
x[p] = value();
}
int main(int argc, char** argv) {
float* x;
cudaMalloc((void**)&x, SIZE*sizeof(float));
dim3 Dg, Db;
Db.x = SIZE;
kernel<<<Dg,Db>>>(x);
return 0;
}
The resulting source and PTX files are attached. These should be added as unit
tests.
Original comment by gregory....@gatech.edu
on 13 Feb 2010 at 8:10
Attachments:
This is implemented in the PTX 2.1 branch
Original comment by gregory....@gatech.edu
on 18 Oct 2010 at 6:47
Original issue reported on code.google.com by
gregory....@gatech.edu
on 7 Jul 2009 at 2:08