Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
FORMUS3IC_LAS3
/
embb
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2edfb1b8
authored
Nov 18, 2014
by
Marcus Winter
Committed by
unknown
Dec 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mtapi_opencl_c: implemented mtapi opencl action plugin
parent
f9fd8a10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
0 deletions
+89
-0
mtapi_opencl_c/CMakeLists.txt
+1
-0
mtapi_opencl_c/include/embb/mtapi/c/mtapi_opencl.h
+64
-0
mtapi_opencl_c/src/embb_mtapi_opencl.c
+0
-0
mtapi_opencl_c/src/embb_mtapi_opencl_runtimelinker.c
+24
-0
No files found.
mtapi_opencl_c/CMakeLists.txt
View file @
2edfb1b8
...
...
@@ -25,6 +25,7 @@ include_directories(${EMBB_MTAPI_OPENCL_INCLUDE_DIRS}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../base_c/include
${
CMAKE_CURRENT_BINARY_DIR
}
/../base_c/include
${
CMAKE_CURRENT_SOURCE_DIR
}
/../mtapi_c/include
${
CMAKE_CURRENT_SOURCE_DIR
}
/../mtapi_c/src
)
add_library
(
embb_mtapi_opencl_c
${
EMBB_MTAPI_OPENCL_C_SOURCES
}
${
EMBB_MTAPI_OPENCL_C_HEADERS
}
)
...
...
mtapi_opencl_c/include/embb/mtapi/c/mtapi_opencl.h
0 → 100644
View file @
2edfb1b8
/*
* Copyright (c) 2014, Siemens AG. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef EMBB_MTAPI_C_MTAPI_OPENCL_H_
#define EMBB_MTAPI_C_MTAPI_OPENCL_H_
#include <embb/mtapi/c/mtapi_ext.h>
#ifdef __cplusplus
extern
"C"
{
#endif
void
mtapi_opencl_plugin_initialize
(
MTAPI_OUT
mtapi_status_t
*
status
);
void
mtapi_opencl_plugin_finalize
(
MTAPI_OUT
mtapi_status_t
*
status
);
mtapi_action_hndl_t
mtapi_opencl_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
);
#ifdef __cplusplus
}
#endif
#endif // EMBB_MTAPI_C_MTAPI_OPENCL_H_
mtapi_opencl_c/src/embb_mtapi_opencl.c
0 → 100644
View file @
2edfb1b8
This diff is collapsed.
Click to expand it.
mtapi_opencl_c/src/embb_mtapi_opencl_runtimelinker.c
View file @
2edfb1b8
...
...
@@ -53,6 +53,11 @@ DECLARECLFUNC(cl_int, clBuildProgram, (cl_program program, cl_uint num_devices,
return
clBuildProgram_Dynamic
(
program
,
num_devices
,
device_list
,
options
,
pfn_notify
,
user_data
);
}
DECLARECLFUNC
(
cl_int
,
clGetProgramBuildInfo
,
(
cl_program
program
,
cl_device_id
device
,
cl_program_build_info
param_name
,
size_t
param_value_size
,
void
*
param_value
,
size_t
*
param_value_size_ret
))
{
return
clGetProgramBuildInfo_Dynamic
(
program
,
device
,
param_name
,
param_value_size
,
param_value
,
param_value_size_ret
);
}
DECLARECLFUNC
(
cl_kernel
,
clCreateKernel
,
(
cl_program
program
,
const
char
*
kernel_name
,
cl_int
*
errcode_ret
))
{
return
clCreateKernel_Dynamic
(
program
,
kernel_name
,
errcode_ret
);
...
...
@@ -78,6 +83,16 @@ DECLARECLFUNC(cl_int, clEnqueueReadBuffer, (cl_command_queue command_queue, cl_m
return
clEnqueueReadBuffer_Dynamic
(
command_queue
,
buffer
,
blocking_read
,
offset
,
cb
,
ptr
,
num_events_in_wait_list
,
event_wait_list
,
event
);
}
DECLARECLFUNC
(
cl_int
,
clSetEventCallback
,
(
cl_event
event
,
cl_int
command_exec_callback_type
,
void
(
CL_CALLBACK
*
pfn_notify
)(
cl_event
,
cl_int
,
void
*
),
void
*
user_data
))
{
return
clSetEventCallback_Dynamic
(
event
,
command_exec_callback_type
,
pfn_notify
,
user_data
);
}
DECLARECLFUNC
(
cl_int
,
clWaitForEvents
,
(
cl_uint
num_events
,
const
cl_event
*
event_list
))
{
return
clWaitForEvents_Dynamic
(
num_events
,
event_list
);
}
DECLARECLFUNC
(
cl_int
,
clReleaseKernel
,
(
cl_kernel
kernel
))
{
return
clReleaseKernel_Dynamic
(
kernel
);
...
...
@@ -103,6 +118,11 @@ DECLARECLFUNC(cl_int, clReleaseMemObject, (cl_mem memobj))
return
clReleaseMemObject_Dynamic
(
memobj
);
}
DECLARECLFUNC
(
cl_int
,
clFlush
,
(
cl_command_queue
command_queue
))
{
return
clFlush_Dynamic
(
command_queue
);
}
DECLARECLFUNC
(
cl_int
,
clFinish
,
(
cl_command_queue
command_queue
))
{
return
clFinish_Dynamic
(
command_queue
);
...
...
@@ -166,16 +186,20 @@ int embb_mtapi_opencl_link_at_runtime() {
CHECKEDIMPORT
(
clCreateBuffer
);
CHECKEDIMPORT
(
clCreateProgramWithSource
);
CHECKEDIMPORT
(
clBuildProgram
);
CHECKEDIMPORT
(
clGetProgramBuildInfo
);
CHECKEDIMPORT
(
clCreateKernel
);
CHECKEDIMPORT
(
clSetKernelArg
);
CHECKEDIMPORT
(
clEnqueueWriteBuffer
);
CHECKEDIMPORT
(
clEnqueueNDRangeKernel
);
CHECKEDIMPORT
(
clEnqueueReadBuffer
);
CHECKEDIMPORT
(
clSetEventCallback
);
CHECKEDIMPORT
(
clWaitForEvents
);
CHECKEDIMPORT
(
clReleaseKernel
);
CHECKEDIMPORT
(
clReleaseProgram
);
CHECKEDIMPORT
(
clReleaseCommandQueue
);
CHECKEDIMPORT
(
clReleaseContext
);
CHECKEDIMPORT
(
clReleaseMemObject
);
CHECKEDIMPORT
(
clFlush
);
CHECKEDIMPORT
(
clFinish
);
CHECKEDIMPORT
(
clCreateSampler
);
CHECKEDIMPORT
(
clReleaseSampler
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment