Hanaa
Hanaa

Reputation: 45

How to query the amount of global memory?

I have used the code in this link to query the amount of global memory available in my device but the return value is ZERO.

is it possible that there is no global memory (DRAM) on the device?

the output

Upvotes: 0

Views: 105

Answers (1)

Robert Crovella
Robert Crovella

Reputation: 152259

is it possible that there is no global memory (DRAM) on the device?

no, not in your case. The 840m has a non-zero amount of global memory, for sure.

The code you linked to is broken because it uses an incorrect format specifier for the global memory variable (%u) when it should be a format specifier for a 64-bit variable (e.g. %lu) here:

printf("Total global memory:           %u\n",  devProp.totalGlobalMem);
                                       ^^

How to query the amount of global memory?

You might be better off running the deviceQuery CUDA sample code , instead.

Upvotes: 3

Related Questions