소스 검색

Rename cuda functions

Nathalie Furmento 15 년 전
부모
커밋
3c7a6bade8
5개의 변경된 파일14개의 추가작업 그리고 17개의 파일을 삭제
  1. 0 4
      include/starpu-util.h
  2. 10 10
      src/datawizard/copy-driver.c
  3. 1 1
      src/datawizard/copy-driver.h
  4. 2 2
      src/drivers/cuda/driver_cuda.c
  5. 1 0
      src/drivers/cuda/driver_cuda.h

+ 0 - 4
include/starpu-util.h

@@ -228,10 +228,6 @@ void starpu_execute_on_each_worker(void (*func)(void *), void *arg, uint32_t whe
 void starpu_create_sync_task(starpu_tag_t sync_tag, unsigned ndeps, starpu_tag_t *deps,
 				void (*callback)(void *), void *callback_arg);
 
-#ifdef USE_CUDA
-cudaStream_t *starpu_get_local_stream(void);
-#endif
-
 #ifdef __cplusplus
 }
 #endif

+ 10 - 10
src/datawizard/copy-driver.c

@@ -117,13 +117,13 @@ cudaStream_t *stream;
 						copy_methods->cuda_to_ram(handle, src_node, dst_node);
 					}
 					else {
-						cures = cudaEventCreate(&req->async_channel.event);
+						cures = cudaEventCreate(&req->async_channel.cuda_event);
 						STARPU_ASSERT(cures == cudaSuccess);
 
-						stream = starpu_get_local_stream();
+						stream = starpu_get_local_cuda_stream();
 						ret = copy_methods->cuda_to_ram_async(handle, src_node, dst_node, stream);
 
-						cures = cudaEventRecord(req->async_channel.event, *stream);
+						cures = cudaEventRecord(req->async_channel.cuda_event, *stream);
 						STARPU_ASSERT(cures == cudaSuccess);
 					}
 				}
@@ -158,13 +158,13 @@ cudaStream_t *stream;
 					copy_methods->ram_to_cuda(handle, src_node, dst_node);
 				}
 				else {
-					cures = cudaEventCreate(&req->async_channel.event);
+					cures = cudaEventCreate(&req->async_channel.cuda_event);
 					STARPU_ASSERT(cures == cudaSuccess);
 
-					stream = starpu_get_local_stream();
+					stream = starpu_get_local_cuda_stream();
 					ret = copy_methods->ram_to_cuda_async(handle, src_node, dst_node, stream);
 
-					cures = cudaEventRecord(req->async_channel.event, *stream);
+					cures = cudaEventRecord(req->async_channel.cuda_event, *stream);
 					STARPU_ASSERT(cures == cudaSuccess);
 				}
 				break;
@@ -262,15 +262,15 @@ void driver_wait_request_completion(starpu_async_channel *async_channel __attrib
 	switch (kind) {
 #ifdef USE_CUDA
 		case CUDA_RAM:
-			event = (*async_channel).event;
+			event = (*async_channel).cuda_event;
 
 			cures = cudaEventSynchronize(event);
 			if (STARPU_UNLIKELY(cures))
-				CUDA_REPORT_ERROR(cures);				
+				CUDA_REPORT_ERROR(cures);
 
 			cures = cudaEventDestroy(event);
 			if (STARPU_UNLIKELY(cures))
-				CUDA_REPORT_ERROR(cures);				
+				CUDA_REPORT_ERROR(cures);
 
 			break;
 #endif
@@ -292,7 +292,7 @@ unsigned driver_test_request_completion(starpu_async_channel *async_channel __at
 	switch (kind) {
 #ifdef USE_CUDA
 		case CUDA_RAM:
-			event = (*async_channel).event;
+			event = (*async_channel).cuda_event;
 
 			success = (cudaEventQuery(event) == cudaSuccess);
 			if (success)

+ 1 - 1
src/datawizard/copy-driver.h

@@ -35,7 +35,7 @@ struct data_request_s;
 typedef union {
 	int dummy;
 #ifdef USE_CUDA
-	cudaEvent_t event;
+	cudaEvent_t cuda_event;
 #endif
 } starpu_async_channel;
 

+ 2 - 2
src/drivers/cuda/driver_cuda.c

@@ -24,7 +24,7 @@ static int ncudagpus;
 
 static cudaStream_t streams[STARPU_NMAXWORKERS];
 
-cudaStream_t *starpu_get_local_stream(void)
+cudaStream_t *starpu_get_local_cuda_stream(void)
 {
 	int worker = starpu_get_worker_id();
 
@@ -42,7 +42,7 @@ static void init_context(int devid)
 	/* force CUDA to initialize the context for real */
 	cudaFree(0);
 
-	cures = cudaStreamCreate(starpu_get_local_stream());
+	cures = cudaStreamCreate(starpu_get_local_cuda_stream());
 	if (STARPU_UNLIKELY(cures))
 		CUDA_REPORT_ERROR(cures);
 }

+ 1 - 0
src/drivers/cuda/driver_cuda.h

@@ -46,6 +46,7 @@ unsigned get_cuda_device_count(void);
 #ifdef USE_CUDA
 void _starpu_init_cuda(void);
 void *_starpu_cuda_worker(void *);
+cudaStream_t *starpu_get_local_cuda_stream(void);
 #endif
 
 #endif //  __DRIVER_CUDA_H__