We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
针对最新的勘误表核对了下2022年10月第5次印刷的书籍。 大部分已经该改正。除了以下几处。
2022年10月第5次印刷的书中代码:
最新oversubscription2.cu代码:
int main(void) { for (int n = 1; n <= N; ++n) { const size_t memory_size = size_t(n) * 1024 * 1024 * 1024; const size_t data_size = memory_size / sizeof(uint64_t); uint64_t *x; CHECK(cudaMallocManaged(&x, memory_size)); gpu_touch<<<(data_size - 1) / 1024 + 1, 1024>>>(x, data_size); CHECK(cudaGetLastError()); CHECK(cudaDeviceSynchronize()); CHECK(cudaFree(x)); printf("Allocated %d GB unified memory with GPU touch.\n", n); } return 0; }
int main(void) { for (int n = 1; n <= N; ++n) { const size_t size = size_t(n) * 1024 * 1024 * 1024; uint64_t *x; CHECK(cudaMallocManaged(&x, size)); gpu_touch<<<size / sizeof(uint64_t) / 1024, 1024>>>(x, size); CHECK(cudaGetLastError()); CHECK(cudaDeviceSynchronize()); CHECK(cudaFree(x)); printf("Allocated %d GB unified memory with GPU touch.\n", n); } return 0; }
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
No branches or pull requests
针对最新的勘误表核对了下2022年10月第5次印刷的书籍。
大部分已经该改正。除了以下几处。
2022年10月第5次印刷的书中代码:
最新oversubscription2.cu代码:
The text was updated successfully, but these errors were encountered: