StarPU Handbook - StarPU Basics
Loading...
Searching...
No Matches
starpu_cuda.h
Go to the documentation of this file.
1/* StarPU --- Runtime system for heterogeneous multicore architectures.
2 *
3 * Copyright (C) 2010-2022 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#ifdef STARPU_USE_CUDA
23#include <cuda.h>
24#include <cuda_runtime.h>
25#include <cuda_runtime_api.h>
26
27#ifdef STARPU_HAVE_LIBNVIDIA_ML
28#include <nvml.h>
29#endif
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
44void starpu_cublas_report_error(const char *func, const char *file, int line, int status);
45
49#define STARPU_CUBLAS_REPORT_ERROR(status) starpu_cublas_report_error(__starpu_func__, __FILE__, __LINE__, status)
50
55void starpu_cuda_report_error(const char *func, const char *file, int line, cudaError_t status);
56
60#define STARPU_CUDA_REPORT_ERROR(status) starpu_cuda_report_error(__starpu_func__, __FILE__, __LINE__, status)
61
75
80const struct cudaDeviceProp *starpu_cuda_get_device_properties(unsigned workerid);
81
93int 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);
94
110int starpu_cuda_copy2d_async_sync(void *src_ptr, unsigned src_node, void *dst_ptr, unsigned dst_node,
111 size_t blocksize,
112 size_t numblocks, size_t ld_src, size_t ld_dst,
113 cudaStream_t stream, enum cudaMemcpyKind kind);
114
131int starpu_cuda_copy3d_async_sync(void *src_ptr, unsigned src_node, void *dst_ptr, unsigned dst_node,
132 size_t blocksize,
133 size_t numblocks_1, size_t ld1_src, size_t ld1_dst,
134 size_t numblocks_2, size_t ld2_src, size_t ld2_dst,
135 cudaStream_t stream, enum cudaMemcpyKind kind);
136
144void starpu_cuda_set_device(unsigned devid);
145
146#ifdef STARPU_HAVE_LIBNVIDIA_ML
151nvmlDevice_t starpu_cuda_get_nvmldev(unsigned devid);
152#endif
153
156#ifdef __cplusplus
157}
158#endif
159
160#endif /* STARPU_USE_CUDA */
161
162#endif /* __STARPU_CUDA_H__ */
void starpu_cuda_report_error(const char *func, const char *file, int line, cudaError_t status)
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)
void starpu_cuda_set_device(unsigned devid)
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)
nvmlDevice_t starpu_cuda_get_nvmldev(unsigned devid)
const struct cudaDeviceProp * starpu_cuda_get_device_properties(unsigned workerid)
cudaStream_t starpu_cuda_get_local_stream(void)
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)