Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allocating a CudaPitchedDeviceVariable using a width and height throws an ErrorInvalidValue exception. #47

Closed
dennisai opened this issue Jul 16, 2017 · 2 comments

Comments

@dennisai
Copy link

Hello,

When I try to execute the following code, I get an ErrorInvalidValue exception.

CudaContext cudaContext = new CudaContext(CudaContext.GetMaxGflopsDeviceId());
CudaPitchedDeviceVariable<ushort> var = new CudaPitchedDeviceVariable<ushort>(
    2048, 160);

I have tried with multiple parameters, such as (16, 16) for my width and height. It appears to work with float but not with ushort. Any idea why it doesn't support ushort?

@robik75
Copy link

robik75 commented Jul 16, 2017

Please see the CUDA DriverAPI documentation: http://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1gcbe9b033f6c4de80f63cc6e58ed9a45a

ElementSizeBytes may be 4, 8 or 16 (since coalesced memory transactions are not possible on other data sizes).

ushort size is 2 bytes

@dennisai
Copy link
Author

Great thank you RoBik75!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants