Skip to content
Snippets Groups Projects
Commit 41f83bff authored by Moises Fernandez's avatar Moises Fernandez
Browse files

change the order for get the Device number after allocating some data in the GPU

parent 3a22cee3
No related branches found
No related tags found
No related merge requests found
......@@ -10,14 +10,17 @@
#include <fstream>
void init_gpu(){
int device;
cudaGetDevice(&device);
printf ("\n...................In the GPU launcher on the device %d...................\n", device);
int *q;
cudaMalloc((void **)&q, sizeof(int));
cudaFree(q);
sync_check("init_gpu");
int device;
cudaGetDevice(&device);
printf ("\n...................In the GPU launcher on the device %d...................\n", device);
sync_check("init_gpu");
}
double timeval_diff(struct timeval *a, struct timeval *b){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment