Skip to content

Found minor misstake on example code #2

Description

@ashiba

I found minor misstake on examples/chapter02/checkDeviceInfor.cu.
The following code is written on line 40-42.

printf("  Total amount of global memory:                 %.2f MBytes (%llu "
           "bytes)\n", (float)deviceProp.totalGlobalMem / pow(1024.0, 3),
           (unsigned long long)deviceProp.totalGlobalMem);

https://github.com/deeperlearning/professional-cuda-c-programming/blob/master/examples/chapter02/checkDeviceInfor.cu#L40

Shouldn't %.2f MBytes be %.2f GBytes
The reason is that this value is obtained by dividing deviceProp.totalGlobalMem by pow(1024.0, 3).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions