Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
7a8dee0
initial commit for public repository
Mar 1, 2015
6f67fdb
add project tree
Mar 1, 2015
7dcc79e
Added read me in project root folder
Mar 1, 2015
45a4f90
work on read me file
Mar 2, 2015
406e438
work on read me file
Mar 2, 2015
ff9f347
added binary flow doc
Mar 2, 2015
7eb56e3
Update Readme
Mar 2, 2015
6046cd5
Update binary flow doc
Mar 2, 2015
54bc484
Added ref to Wiki and Screenshots
Mar 2, 2015
a451362
fixed screenshots link
Mar 2, 2015
5b2aaab
added working WorkingWithMultiplePlatforms text and misc env + doc fixes
Mar 2, 2015
843cd49
Modified Readme, added Mora research group reference
Mar 2, 2015
1c4b8ac
updated .gitignore and license file
Apr 23, 2015
a1732ce
Added memory leak patch
May 2, 2015
bfb924e
Fixed typo
May 5, 2015
e01b528
added more versions of build jni -> nallatech, terasic, intel. Note w…
May 10, 2015
3764b0d
Integrated wagnerse contribution to improve and generalize altera ocl…
Jul 11, 2015
a5dd4aa
Added Dan Poznanovic's bug fix for uninitialized bin folder buffer
Jul 13, 2015
b640aa2
commiting develop v0.1.2 changes
Jul 17, 2015
e712d0c
Changed ConfigSettings to accept calls for all types. Note: Currently…
Jul 21, 2015
b055ba7
work on platform config + added support to c++0x
Jul 22, 2015
480708e
added missing .gitignore for classes folders
Jul 22, 2015
3604d3d
Config Settings V2 -> A more flexible way of per platform config thro…
Jul 23, 2015
119c014
fix default name str bug -> Stringification of define needs two stages
Jul 23, 2015
b1669b0
work on create range from copy function (used in sparkcl)
Aug 26, 2015
1d09704
Work on parallel invoke version + fix aparapi kernel writer not threa…
Sep 1, 2015
4452692
unified use of get platform list
Sep 2, 2015
cd541c8
work on config, mem override, mem align, sync with java-ucores
Mar 19, 2016
7380ad3
Add changelog
orensg Mar 19, 2016
2dc5051
fix link
orensg Mar 19, 2016
21ced01
update changelog
orensg Mar 19, 2016
8a2cc99
Preparing files to be able to merge into master.
freemo Dec 6, 2016
a55b6d2
Merge branch 'test' into next
freemo Dec 6, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ hs_err_pid*
**/include/
**/nbproject/
target/

# java files
*.class
*~
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

Change log can be found at:
https://gitlab.com/mora/aparapi-ucores/wikis/ReleaseNotes


5 changes: 2 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Apache License
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

Expand Down Expand Up @@ -198,5 +198,4 @@ Apache License
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

limitations under the License.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ Kernel kernel = new Kernel() {

Range range = Range.create(result.length);
kernel.execute(range);
```
```
10 changes: 10 additions & 0 deletions agent.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
java \
-agentpath:../../com.amd.aparapi.jni/dist/libaparapi_x86_64.so\
-Dcom.amd.aparapi.useAgent=true\
-Djava.library.path=../third-party/jogamp \
-Dcom.amd.aparapi.executionMode=$1 \
-Dbodies=$2 \
-Dheight=600 \
-Dwidth=600 \
-classpath ../third-party/jogamp/jogl-all.jar:../third-party/jogamp/gluegen-rt.jar:../../com.amd.aparapi/dist/aparapi.jar:nbody.jar \
com.amd.aparapi.examples.nbody.Main
41 changes: 41 additions & 0 deletions docs/APARAPIInstallationNotes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---------------------------------------------------------
APARAPI Installation Notes for CentOS release 6.x (Tested on 6.3/4/5/6)
---------------------------------------------------------

* Note default CentOs repository versions of Java(1.6) and Ant(1.7) are not compatible with latest APARAPI svn src
need to download newr versions (see below)

- install Java JDK
sudo yum install java-1.7.0-openjdk-devel

- install ANT
Download latest ANT -> currently apache-ant-1.9.1-bin.tar.gz
sudo tar xvzf apache-ant-1.9.1-bin.tar.gz -C /opt
sudo ln -s /opt/apache-ant-1.9.1 /opt/ant

- install AMD APP SDK

- needed for build even if hardware not available

- install git

- install g++

sudo yum install gcc-c++

- get src from git repository

git clone ... [project folder]

- set environment vars

source [project folder]/env/aparapiBuildEnv

- build

cd [project folder]/src/aparapi

ant clean build dist



34 changes: 34 additions & 0 deletions docs/AparapiUcoresBinaryFlow.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Aparapi Ucores Binary Flow
--------------------------

This is currently used only for FPGAs but we plan to expand it for general manual optimization/compilation of OpenCL source code.

A Binary flow is one where the Aparapi framework generates an OpenCL file while running and then tries to read and execute the binary compilation of that source file.

Sequence of events
------------------

1. Aparapi Application is executed. Aparapi automatically generates an OpencL source file describing the kernel(file name is the full java kernel class name.cl)

2. Aparapi Application automatically tries to load the binary compiled file (full java kernel class name.aocx)

3. If Aparapi Application finds the compiled file it executes the compiled kernel (runs the kernel on the accelerator) else it will revert to JTP mode in which case the application runs as specified without acceleration (JTP mode). A simulation mode if you will.

How this works for FPGAs
------------------------

1. We first run the Application CPU/GPU/ACC mode. Aparapi-Ucores will generate an OpenCL file (ClassXXXName.cl), but will not find the equivalent binary file (ClassXXXName.aocx). It will revert to another execution mode such as JTP. We can simulate if the kernel works logically correct using JTP.

2. We feed the OpenCL file (ClassXXXName.cl) to an FPGA OpenCL compiler.

Example:

a. aoc ClassXXXName.cl -O3 --board pcie385n_a7 -v --report

b. Wait until an optimized FPGA design is created...currently takes several hours

c. Output of the compiler will be: ClassXXXName.aocx

3. Copy the binary output file (ClassXXXName.aocx) to folder where the .cl file resides.

4. Run application again in ACC/GPU mode. This time Aparapi will detect the ClassXXXName.aocx and use the FPGA as the acclerator.
63 changes: 63 additions & 0 deletions docs/HowToBuildAPARAPI.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@

---------------------------------------------------------
How to build APARAPI from the cmd line after modifications to code
---------------------------------------------------------
* first read APARAPI Installation Notes (APARAPIInstallationNotes.txt) for general instructions on getting the project setup and initial build steps

- open new terminal window

- set environment variables

source [project folder]/env/AlteraV14Env

- to build the APARAPI src tree

cd [project folder]/src/aparapi

ant clean build dist

* this does not build the jni proxy with FPGA support automatically (see below for jni FPGA build)

- to build the APARAPI jni proxy library (should run after initial build and after any changes to CPP source files)

- goto jni dir

cd [project folder]/src/aparapi/com.amd.aparapi.jni/

- to use ant to build standard jni version *

ant

- to use ant to build FPGA jni version *

ant -f build_altera_ocl.xml

* The output of the com.amd.aparapi.jni build is a dll stored in dist folder:

[project folder]/src/aparapi/com.amd.aparapi.jni/dist/libaparapi_x86_64.so

If you have a system where you want to have both FPGA and standard versions available (i.e. with multi OpenCL hardware platforms)you can simply copy the dll's to diffrent locations after the build and link to them through the java vm command line parameters:

Example:

Copy the fpga and standard dll's to the following locations respectively:
/src/aparapi/com.amd.aparapi.jni/dist.fpga/libaparapi_x86_64.so
/src/aparapi/com.amd.aparapi.jni/dist.std/libaparapi_x86_64.so

To select one JNI version or the other at execution time run use the following paramaters to the java command:
java -Djava.library.path=../../com.amd.aparapi.jni/dist.std [rest of cmd line]
java -Djava.library.path=../../com.amd.aparapi.jni/dist.fpga [rest of cmd line]














62 changes: 62 additions & 0 deletions docs/HowToRunAPARAPI.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@

---------------------------------------------------------
How to run APARAPI tests from the cmd line
---------------------------------------------------------

- open new terminal window

- set environment variables

source [project folder]/env/AlteraV14Env

- got to either samples/examples

- samples dir ->

cd [project folder]/src/aparapi/samples

- examples dir->

cd [project folder]/src/aparapi/examples/

- to run any sample or example:

- run the shell script file named after the sample/example name and specify type of run

Format is*:

sh [name].sh [ACC|CPU|JTP|GPU|SEQ]

Examples:

- run nbody simulation
cd [project folder]/src/aparapi/examples/nbody
sh nbody.sh JTP
sh nbody.sh CPU
sh nbody.sh GPU
sh nbody.sh ACC

- run mandel
cd [project folder]/src/aparapi/samples/mandel/
sh mandel.sh JTP
sh mandel.sh CPU
sh mandel.sh GPU
sh mandel.sh ACC


* For more sophisticated use cases with dual configs(fpga/std) you can use the following format:

sh [name].std.sh [ACC|CPU|JTP|GPU|SEQ]

sh [name].fpga.sh [ACC|CPU|JTP|GPU|SEQ]

You can read more about dual config in how to build aparapi.









46 changes: 46 additions & 0 deletions docs/WorkingWithMultiplePlatforms.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
Working with multiple platforms
-------------------------------

The original version of Aparapi does not support platform selection (it just chooses the first available one).

This means that in scenarios where you have multiple OpenCL platforms such as AMD, NVidia, Intel, Altera etc. you do not have control over what accelerator device will be used.

One of the changes we made is to allow selection for platforms that support the OpenCL ICD model.
(https://www.khronos.org/news/permalink/opencl-installable-client-driver-icd-loader)

In the spirit of other Aparapi configuration options for device selection this can be set using a configuration option.

The platform configuration option is called: com.amd.aparapi.platformHint

When this option is set it causes Aparapi to search for the string platformHint inside the available platform names and if it found it will select that platform over other available ones.

You can use it on the command line in the following way:

java -Dcom.amd.aparapi.platformHint=AMD ....

or

java -Dcom.amd.aparapi.platformHint=NVIDIA ....


Nbody simulation example with platform selection
---------------------------------------------------------------------

The script nbody.std.no-opengles-platform-select.sh contains the following java command line:

java \
-Djava.library.path=../../com.amd.aparapi.jni/dist.std:../third-party/jogamp \
-Dcom.amd.aparapi.executionMode=$1 \
-Dbodies=$2 \
-Dcom.amd.aparapi.platformHint=$3 \
-Dheight=600 \
-Dwidth=600 \
-Djogl.disable.opengles \
-classpath ../third-party/jogamp/jogl-all.jar:../third-party/jogamp/gluegen-rt.jar:../../com.amd.aparapi/dist/aparapi.jar:nbody.jar \
com.amd.aparapi.examples.nbody.Main

To choose an AMD GPU for example we would invoke the script in the following way(the third parameter):

nbody.std.no-opengles-platform-select.sh GPU 1024 AMD


8 changes: 8 additions & 0 deletions env/AlteraV14Env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export QUARTUS_ROOTDIR=/home/sdev/altera/14.0/quartus
export PATH=$PATH:$QUARTUS_ROOTDIR/bin
export ALTERAOCLSDKROOT=/home/sdev/altera/14.0/hld
export LD_LIBRARY_PATH=$ALTERAOCLSDKROOT/host/linux64/lib:$ALTERAOCLSDKROOT/board/nalla_pcie/linux64/lib
export PATH=$PATH:$ALTERAOCLSDKROOT/bin
export AOCL_BOARD_PACKAGE_ROOT=/home/sdev/altera/14.0/hld/board/nalla_pcie
export LM_LICENSE_FILE=[your license file here]

6 changes: 6 additions & 0 deletions env/aparapiBuildEnv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Ant build environment
export ANT_HOME=/opt/ant
export PATH=${PATH}:${ANT_HOME}/bin



10 changes: 10 additions & 0 deletions env/mahoutEnv
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Generated file for hadoop/mahout env
export JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64/
#export HADOOP_HOME=/usr/local/hadoop-1.2.0/
export HADOOP_DIR=/usr/local/hadoop-1.2.0
export HADOOP_PREFIX=$HADOOP_DIR/
export HADOOP_CONF_DIR=HADOOP_DIR/conf
export MAHOUT_HOME=/usr/local/mahout-0.9/
export MAHOUT_VERSION=0.9-SNAPSHOT
#export MAVEN_OPTS=-Xmx1024m

17 changes: 0 additions & 17 deletions examples/correlation-matrix/.project

This file was deleted.

15 changes: 15 additions & 0 deletions local.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@echo off

java ^
-Djava.library.path=..\..\com.amd.aparapi.jni\dist;..\third-party\jogamp ^
-Dcom.amd.aparapi.executionMode=%1 ^
-Dcom.amd.aparapi.enableShowGeneratedOpenCL=true ^
-Dcom.amd.aparapi.enableVerboseJNI=false ^
-Dcom.amd.aparapi.enableProfiling=true ^
-Dbodies=%2 ^
-Dheight=600 ^
-Dwidth=600 ^
-classpath ..\third-party\jogamp\gluegen-rt.jar;..\third-party\jogamp\jogl.all.jar;..\..\com.amd.aparapi\dist\aparapi.jar;nbody.jar ^
com.amd.aparapi.examples.nbody.Local


16 changes: 16 additions & 0 deletions nbody-agent.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@echo off

java ^
-agentpath:../../com.amd.aparapi.jni/dist/aparapi_x86_64.dll ^
-Dcom.amd.aparapi.useAgent=true ^
-Djava.library.path=..\third-party\jogamp ^
-Dcom.amd.aparapi.executionMode=%1 ^
-Dcom.amd.aparapi.enableProfiling=false ^
-Dcom.amd.aparapi.enableShowGeneratedOpenCL=true ^
-Dbodies=%2 ^
-Dheight=600 ^
-Dwidth=600 ^
-classpath ..\third-party\jogamp\gluegen-rt.jar;..\third-party\jogamp\jogl-all.jar;..\..\com.amd.aparapi\dist\aparapi.jar;nbody.jar ^
com.amd.aparapi.examples.nbody.Main


15 changes: 15 additions & 0 deletions nbody.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@echo off

java ^
-Djava.library.path=..\..\com.amd.aparapi.jni\dist;..\third-party\jogamp ^
-Dcom.amd.aparapi.executionMode=%1 ^
-Dcom.amd.aparapi.enableProfiling=false ^
-Dcom.amd.aparapi.enableShowGeneratedOpenCL=true ^
-Dcom.amd.aparapi.logLevel=SEVERE ^
-Dbodies=%2 ^
-Dheight=600 ^
-Dwidth=600 ^
-classpath ..\third-party\jogamp\gluegen-rt.jar;..\third-party\jogamp\jogl-all.jar;..\..\com.amd.aparapi\dist\aparapi.jar;nbody.jar ^
com.amd.aparapi.examples.nbody.Main


Loading