Created
December 1, 2017 14:13
-
-
Save PatWie/d5141efcaaa47c2213639c96dc5504e9 to your computer and use it in GitHub Desktop.
test nvidia-smi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// compile me by nvcc copy.cu -o test | |
#include <iostream> | |
int main(int argc, char const *argv[]) | |
{ | |
const size_t MB = 10; | |
const size_t len = MB*256; | |
float *d_ptr, *h_ptr; | |
h_ptr = new float[len]; | |
cudaMalloc(&d_ptr, len*sizeof(float)); | |
for (int i = 0; i < 150000000; ++i) | |
{ | |
cudaMemcpy(d_ptr, h_ptr, len*sizeof(float), cudaMemcpyHostToDevice); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment