StarPU Handbook
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
starpu_cuda.h
Go to the documentation of this file.
1 /* StarPU --- Runtime system for heterogeneous multicore architectures.
2  *
3  * Copyright (C) 2010-2012, 2014 Université de Bordeaux
4  * Copyright (C) 2010, 2011, 2012, 2013 Centre National de la Recherche Scientifique
5  *
6  * StarPU is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation; either version 2.1 of the License, or (at
9  * your option) any later version.
10  *
11  * StarPU is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  *
15  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
16  */
17 
18 #ifndef __STARPU_CUDA_H__
19 #define __STARPU_CUDA_H__
20 
21 #include <starpu_config.h>
22 
23 #if defined STARPU_USE_CUDA && !defined STARPU_DONT_INCLUDE_CUDA_HEADERS
24 #include <cuda.h>
25 #include <cuda_runtime.h>
26 #include <cuda_runtime_api.h>
27 
28 #ifdef __cplusplus
29 extern "C"
30 {
31 #endif
32 
33 void starpu_cublas_report_error(const char *func, const char *file, int line, int status);
34 #define STARPU_CUBLAS_REPORT_ERROR(status) \
35  starpu_cublas_report_error(__starpu_func__, __FILE__, __LINE__, status)
36 
37 void starpu_cuda_report_error(const char *func, const char *file, int line, cudaError_t status);
38 #define STARPU_CUDA_REPORT_ERROR(status) \
39  starpu_cuda_report_error(__starpu_func__, __FILE__, __LINE__, status)
40 
41 cudaStream_t starpu_cuda_get_local_stream(void);
42 
43 const struct cudaDeviceProp *starpu_cuda_get_device_properties(unsigned workerid);
44 
45 int starpu_cuda_copy_async_sync(void *src_ptr, unsigned src_node, void *dst_ptr, unsigned dst_node, size_t ssize, cudaStream_t stream, enum cudaMemcpyKind kind);
46 
47 void starpu_cuda_set_device(unsigned devid);
48 
49 #ifdef __cplusplus
50 }
51 #endif
52 
53 #endif /* STARPU_USE_CUDA && !STARPU_DONT_INCLUDE_CUDA_HEADERS */
54 #endif /* __STARPU_CUDA_H__ */
55 
void starpu_cuda_set_device(unsigned devid)
int starpu_cuda_copy_async_sync(void *src_ptr, unsigned src_node, void *dst_ptr, unsigned dst_node, size_t ssize, cudaStream_t stream, enum cudaMemcpyKind kind)
const struct cudaDeviceProp * starpu_cuda_get_device_properties(unsigned workerid)
void starpu_cuda_report_error(const char *func, const char *file, int line, cudaError_t status)
cudaStream_t starpu_cuda_get_local_stream(void)