Browse Source

Do not use starpu_cuda_set_device while calibrating the bus: since we clear things with cudaThreadExit, opengl interoperability can be enabled at proper starpu initialization

Samuel Thibault 13 years ago
parent
commit
226d8973c7
1 changed files with 4 additions and 4 deletions
  1. 4 4
      src/core/perfmodel/perfmodel_bus.c

+ 4 - 4
src/core/perfmodel/perfmodel_bus.c

@@ -94,7 +94,7 @@ static void measure_bandwidth_between_host_and_dev_on_cpu_with_cuda(int dev, int
 	size_t size = SIZE;
 
 	/* Initialize CUDA context on the device */
-	starpu_cuda_set_device(dev);
+	cudaSetDevice(dev);
 
 	/* hack to avoid third party libs to rebind threads */
 	_starpu_bind_thread_on_cpu(config, cpu);
@@ -189,7 +189,7 @@ static void measure_bandwidth_between_dev_and_dev_cuda(int src, int dst)
         if (size > prop.totalGlobalMem/4) size = prop.totalGlobalMem/4;
 
 	/* Initialize CUDA context on the source */
-	starpu_cuda_set_device(src);
+	cudaSetDevice(src);
 
 	cures = cudaDeviceCanAccessPeer(&can, src, dst);
 	if (!cures && can) {
@@ -205,7 +205,7 @@ static void measure_bandwidth_between_dev_and_dev_cuda(int src, int dst)
 	cudaMemset(s_buffer, 0, size);
 
 	/* Initialize CUDA context on the destination */
-	starpu_cuda_set_device(dst);
+	cudaSetDevice(dst);
 
 	cures = cudaDeviceCanAccessPeer(&can, dst, src);
 	if (!cures && can) {
@@ -239,7 +239,7 @@ static void measure_bandwidth_between_dev_and_dev_cuda(int src, int dst)
 
 	/* Free buffers */
 	cudaFree(d_buffer);
-	starpu_cuda_set_device(src);
+	cudaSetDevice(src);
 	cudaFree(s_buffer);
 
 	cudaThreadExit();