I have the following function and like to see array length. The array length pointed should be 91200 and 1459200, but they are printed as (size of input 8 size of output 8). What could be wrong in the following code.
int ResizeAreaInference(cudaStream_t stream, const void* inputs, void* outputs, int upscale, int w, int h, int c)
{
//static int cnt=0;
int n = (int)(w*h);
const int THREADS_PER_BLOCK = 128;
const int NUMBLOCKS = (int)((float)(n+THREADS_PER_BLOCK-1)/THREADS_PER_BLOCK);
ResizeAreaKernel<<<NUMBLOCKS, THREADS_PER_BLOCK, 0, stream>>>(static_cast<const float*>(inputs), static_cast<float*>(outputs), upscale, w, h, c, n);
cudaDeviceSynchronize();
//if(cnt==0){
// printdatain(static_cast<const float*>(inputs), w*h*c, "inputs.txt", w*c);
// printdataout(static_cast<float*>(outputs), w*upscale*h*upscale*c, "outputs.txt", w*upscale*c);
//}
//cnt++;
const float *input = static_cast<const float*>(inputs);
float *output = static_cast<float*>(outputs);
std::cout << "size of input " << sizeof(input) << " size of output " << sizeof(output) << std::endl;
return 0;
}
Aucun commentaire:
Enregistrer un commentaire