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

Support for cudaGetDeviceProperties #39

Open
mxmlnkn opened this issue Mar 22, 2016 · 3 comments
Open

Support for cudaGetDeviceProperties #39

mxmlnkn opened this issue Mar 22, 2016 · 3 comments

Comments

@mxmlnkn
Copy link
Contributor

mxmlnkn commented Mar 22, 2016

I have some code, which queries cudaGetDeviceProperties for multiProcessorCount and maxThreadsPerMultiProcessor in order to determine how many blocks, threads and streams to start.

It would be cool if cupla could emulate the device properties to some extent for this kind of use-case by mapping it onto corresponding features. E.g. maxThreadsPerMultiProcessor = OMP_NUM_CORES, multiProcessorCount=1;

@ax3l ax3l added the question label Mar 29, 2016
@ax3l
Copy link
Member

ax3l commented Sep 23, 2019

Also, as in alpaka-group/alpaka#846, these should be replaced with cudaDeviceGetAttribute for the CUDA backend.

@jyoung3131
Copy link

I realize this is an older issue but I would suggest having some documentation on how to replace calls for cudaGetDeviceProp in the porting guide since it's pretty common to query at least a few things - I realize with a non-CUDA backend it's likely to be a NOP but some warnings might be nice.

The runtime backend page suggests using "alpaka::getAccDevProps" but there doesn't seem to be any notes on how to use this.
https://alpaka.readthedocs.io/en/latest/dev/backends.html#cuda-runtime-api

@sbastrakov
Copy link
Member

sbastrakov commented Aug 3, 2021

So alpaka's getAccDevProps is a reduced subset of what CUDA has as device properties. It returns this structure. In practice we call the native version inside guards when we need more specific info.

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

No branches or pull requests

4 participants