Embedded Multicore Building Blocks V1.0.0
mtapi_cuda.h
1 /*
2  * Copyright (c) 2014, Siemens AG. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are met:
6  *
7  * 1. Redistributions of source code must retain the above copyright notice,
8  * this list of conditions and the following disclaimer.
9  *
10  * 2. Redistributions in binary form must reproduce the above copyright notice,
11  * this list of conditions and the following disclaimer in the documentation
12  * and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24  * POSSIBILITY OF SUCH DAMAGE.
25  */
26 
27 #ifndef EMBB_MTAPI_C_MTAPI_CUDA_H_
28 #define EMBB_MTAPI_C_MTAPI_CUDA_H_
29 
30 
31 #include <embb/mtapi/c/mtapi_ext.h>
32 
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 
72  MTAPI_OUT mtapi_status_t* status
74 );
75 
107  MTAPI_OUT mtapi_status_t* status
109 );
110 
178  MTAPI_IN mtapi_job_id_t job_id,
179  MTAPI_IN char* kernel_source,
180  MTAPI_IN char* kernel_name,
181  MTAPI_IN mtapi_size_t local_work_size,
183  MTAPI_IN mtapi_size_t element_size,
185  MTAPI_IN void* node_local_data,
186  MTAPI_IN mtapi_size_t node_local_data_size,
188  MTAPI_OUT mtapi_status_t* status
190 );
191 
192 typedef struct CUctx_st * CUcontext;
193 
201 CUcontext mtapi_cuda_get_context(
202  MTAPI_OUT mtapi_status_t* status
204 );
205 
206 #ifdef __cplusplus
207 }
208 #endif
209 
210 
211 #endif // EMBB_MTAPI_C_MTAPI_CUDA_H_
void mtapi_cuda_plugin_finalize(MTAPI_OUT mtapi_status_t *status)
Finalizes the MTAPI CUDA environment on the local MTAPI node.
CUcontext mtapi_cuda_get_context(MTAPI_OUT mtapi_status_t *status)
Retrieves the handle of the CUDA context used by the plugin.
struct mtapi_action_hndl_struct mtapi_action_hndl_t
Action handle type.
Definition: mtapi.h:979
void mtapi_cuda_plugin_initialize(MTAPI_OUT mtapi_status_t *status)
Initializes the MTAPI CUDA environment on a previously initialized MTAPI node.
mtapi_action_hndl_t mtapi_cuda_action_create(MTAPI_IN mtapi_job_id_t job_id, MTAPI_IN char *kernel_source, MTAPI_IN char *kernel_name, MTAPI_IN mtapi_size_t local_work_size, MTAPI_IN mtapi_size_t element_size, MTAPI_IN void *node_local_data, MTAPI_IN mtapi_size_t node_local_data_size, MTAPI_OUT mtapi_status_t *status)
This function creates a CUDA action.