tkestack / vcuda-controller

Other
488 stars 156 forks source link

Doubts about cuArray3DCreate_helper calculating memory usage #18

Closed pidb closed 1 year ago

pidb commented 2 years ago

I see the function

https://github.com/tkestack/vcuda-controller/blob/5ec3fcbc58679bbbbd82ef9e21d647d8d7383876/src/hijack_call.c#L713-L731

so, should it be change to

    request_size = base_size * pAllocateArray->NumChannels *
                   pAllocateArray->Height * pAllocateArray->Width * pAllocateArray->Depth;
mYmNeo commented 2 years ago

I see the function

https://github.com/tkestack/vcuda-controller/blob/5ec3fcbc58679bbbbd82ef9e21d647d8d7383876/src/hijack_call.c#L713-L731

so, should it be change to

    request_size = base_size * pAllocateArray->NumChannels *
                   pAllocateArray->Height * pAllocateArray->Width * pAllocateArray->Depth;

I'm not familiar with this api, maybe the calculation of memory is wrong, could you help to validate this?

pidb commented 2 years ago

I see the function https://github.com/tkestack/vcuda-controller/blob/5ec3fcbc58679bbbbd82ef9e21d647d8d7383876/src/hijack_call.c#L713-L731

so, should it be change to

    request_size = base_size * pAllocateArray->NumChannels *
                   pAllocateArray->Height * pAllocateArray->Width * pAllocateArray->Depth;

I'm not familiar with this api, maybe the calculation of memory is wrong, could you help to validate this?

I see the function https://github.com/tkestack/vcuda-controller/blob/5ec3fcbc58679bbbbd82ef9e21d647d8d7383876/src/hijack_call.c#L713-L731

so, should it be change to

    request_size = base_size * pAllocateArray->NumChannels *
                   pAllocateArray->Height * pAllocateArray->Width * pAllocateArray->Depth;

I'm not familiar with this api, maybe the calculation of memory is wrong, could you help to validate this?

Of course, I will verify and try to fix it later.

mYmNeo commented 1 year ago

28