-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from ctuning/issue-22
Add OpenCL v1.1. stab #19
- Loading branch information
Showing
21 changed files
with
3,084 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
51417bde2463db8f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
lib-opencl-1.1-stubs-android |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"backup_data_uid": "51417bde2463db8f", | ||
"backup_module_uid": "1dc07ee0f4742028", | ||
"backup_module_uoa": "package", | ||
"control": { | ||
"author": "Grigori Fursin", | ||
"author_email": "[email protected]", | ||
"author_webpage": "http://fursin.net", | ||
"copyright": "See CK COPYRIGHT.txt for copyright details", | ||
"engine": "CK", | ||
"iso_datetime": "2017-01-13T13:46:16.355876", | ||
"license": "See CK LICENSE.txt for licensing details", | ||
"version": [ | ||
"1", | ||
"8", | ||
"6", | ||
"1" | ||
] | ||
}, | ||
"data_name": "lib-opencl-1.1-stubs-android" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"customize": { | ||
"extra_dir": "", | ||
"skip_copy_to_remote": "yes", | ||
"skip_ext": "yes", | ||
"version": "1.1" | ||
}, | ||
"deps": { | ||
"compiler": { | ||
"local": "yes", | ||
"name": "C compiler", | ||
"sort": 10, | ||
"tags": "compiler,lang-c" | ||
} | ||
}, | ||
"end_full_path": { | ||
"android": "lib$#sep#$libOpenCL.so" | ||
}, | ||
"only_for_host_os_tags": [ | ||
"windows", | ||
"linux" | ||
], | ||
"only_for_target_os_tags": [ | ||
"android" | ||
], | ||
"process_script": "process", | ||
"soft_uoa": "6eb9a57038688ad3", | ||
"suggested_path": "lib-opencl-stubs", | ||
"tags": [ | ||
"lib", | ||
"opencl", | ||
"lang-c", | ||
"lang-cpp" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Grigori Fursin downloaded and converted cl.h from Khronos website and created stubs lib | ||
needed for compiling OpenCL-based programs for Android mobile devices: | ||
|
||
* https://www.khronos.org/registry/cl/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
cd include | ||
cd CL | ||
|
||
wget https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/opencl.h | ||
wget https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/cl_platform.h | ||
wget https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/cl.h | ||
wget https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/cl_ext.h | ||
wget https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/cl_egl.h | ||
wget https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/cl_dx9_media_sharing.h | ||
wget https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/cl_d3d10.h | ||
wget https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/cl_d3d11.h | ||
wget https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/cl_gl.h | ||
wget https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/cl_gl_ext.h | ||
wget https://www.khronos.org/registry/cl/api/2.1/cl.hpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
python _process.py include/CL/cl.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import sys | ||
import os | ||
|
||
lib=sys.argv[1] | ||
|
||
f=open(lib, 'r') | ||
s=f.read() | ||
f.close() | ||
|
||
o ='/**********************************************************\n' | ||
o+=' Automatically generated for Collective Knowledge Framework\n' | ||
o+=' http://github.com/ctuning/ck\n' | ||
o+='\n' | ||
o+=' (C)opyright 2016 by Grigori Fursin (cTuning foundation)\n' | ||
o+='\n' | ||
o+=' Released under the same license as OpenCL\n' | ||
o+=' (see include/CL/cl.h)\n' | ||
o+='**********************************************************/\n' | ||
o+='\n' | ||
o+='#include <CL/cl.h>\n' | ||
o+='\n' | ||
|
||
ll=s.split('\n') | ||
|
||
w=False | ||
for l in ll: | ||
if w: | ||
if l.endswith(';'): | ||
w=False | ||
lx=l[:-1]+'\n' | ||
lx+='{}\n' | ||
lx+='\n' | ||
else: | ||
lx=l+'\n' | ||
|
||
# Process var names | ||
i1=lx.find('/*') | ||
if i1>0: | ||
i2=lx.find('*/',i1) | ||
if i2>0: | ||
vr=lx[i1+2:i2-1].strip() | ||
if vr.endswith('[3]'): | ||
vr=vr[:-3] | ||
lx=lx[:i1-1]+' '+vr+' '+lx[i2+2:] | ||
|
||
o+=lx | ||
|
||
elif l.startswith('extern CL_API_ENTRY ') and l.find('_DEPRECATED')<0: | ||
w=True | ||
o+=l[7:]+'\n' | ||
|
||
# Write CK json | ||
f=open('lib/stubs.c','wt') | ||
f.write(o) | ||
f.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
@echo off | ||
|
||
rem | ||
rem Make script for CK libraries | ||
rem (depends on configured/installed compilers via CK) | ||
rem | ||
rem See CK LICENSE.txt for licensing details. | ||
rem See CK Copyright.txt for copyright details. | ||
rem | ||
rem Developer(s): Grigori Fursin, 2015 | ||
rem | ||
|
||
set CK_SOURCE_FILES=stubs.c | ||
set CK_OBJ_FILES=stubs%CK_OBJ_EXT% | ||
set LIB_NAME=libOpenCL | ||
|
||
set CK_COMPILER_FLAGS_MISC=%CK_FLAG_PREFIX_INCLUDE%../include %CK_COMPILER_FLAGS_MISC% | ||
|
||
echo. | ||
echo Building dynamic library ... | ||
echo. | ||
|
||
set CK_TARGET_FILE=%LIB_NAME%%CK_DLL_EXT% | ||
set CK_TARGET_FILE_D=%CK_TARGET_FILE% | ||
|
||
set CK_CC_FLAGS=%CK_COMPILER_FLAGS_OBLIGATORY% %CK_COMPILER_FLAGS_MISC% %CK_COMPILER_FLAGS_CC_OPTS% %CK_COMPILER_FLAGS_ARCH% %CK_COMPILER_FLAGS_PAR% | ||
|
||
echo Executing %CK_CC% %CK_OPT_SPEED% %CK_FLAGS_DLL% %CK_CC_FLAGS% %CK_SOURCE_FILES% %CK_FLAGS_OUTPUT%%CK_TARGET_FILE% %CK_FLAGS_DLL_EXTRA% %CK_LD_FLAGS_MISC% %CK_LD_FLAGS_EXTRA% | ||
%CK_CC% %CK_OPT_SPEED% %CK_FLAGS_DLL% %CK_CC_FLAGS% %CK_SOURCE_FILES% %CK_FLAGS_OUTPUT%%CK_TARGET_FILE% %CK_FLAGS_DLL_EXTRA% %CK_LD_FLAGS_MISC% %CK_LD_FLAGS_EXTRA% | ||
if %errorlevel% neq 0 ( | ||
echo. | ||
echo Building failed! | ||
goto err | ||
) | ||
|
||
echo. | ||
echo Installing ... | ||
echo. | ||
|
||
mkdir %INSTALL_DIR%\lib | ||
copy /B %CK_TARGET_FILE_D% %INSTALL_DIR%\lib | ||
|
||
exit /b 0 | ||
|
||
:err | ||
set /p x=Press any key to continue! | ||
exit /b 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#! /bin/bash | ||
|
||
# | ||
# Make script for CK libraries | ||
# (depends on configured/installed compilers via CK) | ||
# | ||
# See CK LICENSE.txt for licensing details. | ||
# See CK Copyright.txt for copyright details. | ||
# | ||
# Developer(s): Grigori Fursin, 2015 | ||
# | ||
|
||
|
||
echo "" | ||
echo "cmake is not required for vis version just copy libOpenCL.so..." | ||
echo "" | ||
|
||
|
Oops, something went wrong.