StarPU Handbook
starpu_cuda.h
Go to the documentation of this file.
1 /* StarPU --- Runtime system for heterogeneous multicore architectures.
2  *
3  * Copyright (C) 2010-2020 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
4  *
5  * StarPU is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as published by
7  * the Free Software Foundation; either version 2.1 of the License, or (at
8  * your option) any later version.
9  *
10  * StarPU is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13  *
14  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
15  */
16 
17 #ifndef __STARPU_CUDA_H__
18 #define __STARPU_CUDA_H__
19 
20 #include <starpu_config.h>
21 
22 #if defined STARPU_USE_CUDA && !defined STARPU_DONT_INCLUDE_CUDA_HEADERS
23 #include <cuda.h>
24 #include <cuda_runtime.h>
25 #include <cuda_runtime_api.h>
26 
27 #ifdef __cplusplus
28 extern "C"
29 {
30 #endif
31 
40 void starpu_cublas_report_error(const char *func, const char *file, int line, int status);
41 
45 #define STARPU_CUBLAS_REPORT_ERROR(status) starpu_cublas_report_error(__starpu_func__, __FILE__, __LINE__, status)
46 
50 void starpu_cuda_report_error(const char *func, const char *file, int line, cudaError_t status);
51 
55 #define STARPU_CUDA_REPORT_ERROR(status) starpu_cuda_report_error(__starpu_func__, __FILE__, __LINE__, status)
56 
68 cudaStream_t starpu_cuda_get_local_stream(void);
69 
74 const struct cudaDeviceProp *starpu_cuda_get_device_properties(unsigned workerid);
75 
85 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);
86 
100 int starpu_cuda_copy2d_async_sync(void *src_ptr, unsigned src_node, void *dst_ptr, unsigned dst_node,
101  size_t blocksize,
102  size_t numblocks, size_t ld_src, size_t ld_dst,
103  cudaStream_t stream, enum cudaMemcpyKind kind);
104 
119 int starpu_cuda_copy3d_async_sync(void *src_ptr, unsigned src_node, void *dst_ptr, unsigned dst_node,
120  size_t blocksize,
121  size_t numblocks_1, size_t ld1_src, size_t ld1_dst,
122  size_t numblocks_2, size_t ld2_src, size_t ld2_dst,
123  cudaStream_t stream, enum cudaMemcpyKind kind);
124 
130 void starpu_cuda_set_device(unsigned devid);
131 
134 #ifdef __cplusplus
135 }
136 #endif
137 
138 #endif /* STARPU_USE_CUDA && !STARPU_DONT_INCLUDE_CUDA_HEADERS */
139 
140 #endif /* __STARPU_CUDA_H__ */
void starpu_cuda_set_device(unsigned devid)
int starpu_cuda_copy3d_async_sync(void *src_ptr, unsigned src_node, void *dst_ptr, unsigned dst_node, size_t blocksize, size_t numblocks_1, size_t ld1_src, size_t ld1_dst, size_t numblocks_2, size_t ld2_src, size_t ld2_dst, cudaStream_t stream, enum cudaMemcpyKind kind)
void starpu_cublas_report_error(const char *func, const char *file, int line, int status)
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)
int starpu_cuda_copy2d_async_sync(void *src_ptr, unsigned src_node, void *dst_ptr, unsigned dst_node, size_t blocksize, size_t numblocks, size_t ld_src, size_t ld_dst, cudaStream_t stream, enum cudaMemcpyKind kind)
void starpu_cuda_report_error(const char *func, const char *file, int line, cudaError_t status)
const struct cudaDeviceProp * starpu_cuda_get_device_properties(unsigned workerid)
cudaStream_t starpu_cuda_get_local_stream(void)